home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / wattcp / loadsys.doc < prev    next >
Encoding:
Text File  |  1992-03-05  |  129.3 KB  |  2,740 lines

  1. * C:\DOC\LOADSYS.DOC ***** 5 MAR 92 ** 10:32 ******; G W Robinson
  2.  
  3.                    R A L   I B M   P C   U S E R   G U I D E
  4.                    -----------------------------------------
  5.  
  6.                  LOADSYS TSR and Device Driver loader/unloader
  7.                  ---------------------------------------------
  8.       Contents
  9.       ========
  10.       1.    Introduction and Disclaimer
  11.  
  12.       2.    Overview
  13.       2.1     Interrupts
  14.       2.2     Memory Allocation
  15.       2.3     TSRs
  16.       2.4     Device Drivers
  17.       2.5     I/O Port and Memory Modification
  18.       2.6     LOADSYS features
  19.       2.7     Loading at different positions in memory
  20.       2.8     Upper Memory
  21.       2.9     Extended Memory
  22.       2.10    Expanded Memory
  23.       2.11    Expanded Memory Managers
  24.       2.12    LOADSYS Support of EMMs
  25.       2.13    Moving system code and data
  26.       2.14    Summary
  27.  
  28.       3.    LOADSYS
  29.       3.1     Description
  30.       3.2     Notes
  31.  
  32.       4.    Usage Guidelines
  33.       4.1     BAT files
  34.       4.2     Upper Memory
  35.       4.3     Control Programs (Windows 3 and DESQview)
  36.       4.4     Additional Features
  37.  
  38.       5.    Worked Examples
  39.       5.1     PRINT
  40.       5.2     Communications Cards
  41.       5.3     RAINBOW
  42.       5.3.1     RAINBOW over BICC 8 bit card MPS v3
  43.       5.3.2     RAINBOW over BICC cards using MPS v4
  44.       5.3.3     RAINBOW over BICC cards using Packet Driver
  45.       5.3.4     RAINBOW over other cards using Packet Driver
  46.       5.4     TCP/IP
  47.       5.4.1     PC/TCP over BICC cards
  48.       5.4.2     PC/TCP over other cards using Packet Driver
  49.       5.5     PC-NFS
  50.       5.5.1     PC-NFS over Packet Driver
  51.       5.5.2     PC-NFS over 3COM cards
  52.       5.6     PC3270
  53.       5.7     MOS2
  54.       5.8     Upper Memory
  55.  
  56.       6.    Bugs/Features and Problem Programs
  57.  
  58.       7.    Differences in LOADSYS versions
  59.  
  60.       8.    Support and Acknowledgements
  61.  
  62.  
  63.       1. Introduction and Disclaimer
  64.       ==============================
  65.  
  66.       The author and his employers accept no responsibilty for any damage
  67.       done by this software.  It is run strictly at the users risk and
  68.       all necessary precautions, such as backing up of discs, should be
  69.       taken before hand.
  70.  
  71.       This document descibes LOADSYS which is a program that can load and
  72.       unload Terminate and Stay Resident programs (TSRs) such as PRINT
  73.       and also Device Drivers such as ANSI.SYS and VDISK.SYS.
  74.  
  75.       For Device Drivers this means that they no longer have to be
  76.       defined in CONFIG.SYS and loaded when the PC is booted up.  They
  77.       can be loaded when needed by LOADSYS and unloaded when not required
  78.       thus removing the need to reboot the machine when the memory they
  79.       occupy is needed by other programs.
  80.  
  81.       For TSRs which do not have an unload facility LOADSYS allows them
  82.       to be removed from memory when they are no longer required.
  83.  
  84.       LOADSYS also contains a host of supporting features.  These include
  85.       memory and I/O port reading and resetting and the listing of
  86.       internal DOS tables. LOADSYS is also able to interface to expanded
  87.       memory via drivers that support the LIM 3.2 or 4.0 interface. These
  88.       include systems that map extended to expanded memory such as are
  89.       found on 386 machines.
  90.  
  91.       However as with all good things there are some drawbacks.  LOADSYS
  92.       has only limited facilities to shut down the program it is
  93.       unloading.  Hence you have to use some commonsense before doing an
  94.       unload.  For example unloading PRINT while it is still printing is
  95.       not a good idea.  Similarily unloading a communications TSR whilst
  96.       it is in use may have undesired effects.
  97.  
  98.       A second drawback is that although the unloading process frees the
  99.       memory used by the Device Driver or TSR this may result in a gap in
  100.       memory because of other programs that have been loaded after it.
  101.       LOADSYS is able to move programs down memory to fill such holes but
  102.       there is no guarantee the program would still work correctly - in
  103.       fact it is highly likley it would fail hence the facility should be
  104.       used with care.  It is prudent to take account the order of loading
  105.       programs when several are involved.
  106.  
  107.       LOADSYS was developed and tested mainly under DOS 3.3 though it
  108.       should work on all versions of DOS from 2.0 to 5.0.  DOS 5 is
  109.       rather special in that it introduces its own memory management
  110.       facilities and LOADSYS is able to interface to these.  It has not
  111.       been tested under OS/2 and is unlikely to work in that environment.
  112.       A list of problem programs is given near the end of this document.
  113.  
  114.       The current version is 1.4b and it contains enhancements to cope
  115.       with DOS 5 and memory managers.  Note that as this needed major
  116.       recoding there are likely to be problems that have not yet been
  117.       found.  V1.3 will therefore remain available until 1.4 is proven.
  118.       Changes from previous versions are noted at the end of this file.
  119.  
  120.  
  121.  
  122.       2. Overview
  123.       ===========
  124.  
  125.       This section gives an overview of how LOADSYS works.  It is
  126.       essential reading only if you wish to use the expert facilities or
  127.       to understand a little of whats going on.
  128.  
  129.       2.1 Interrupts
  130.       --------------
  131.  
  132.       Before describing how LOADSYS works it is necessary to understand a
  133.       little about some of the features of the PC.  The first one to
  134.       consider is an interrupt and these are generated by two possible
  135.       means.  Hardware interrupts are generated by a hardware event such
  136.       as pressing a key on the keyboard or the timer tick that occurs
  137.       18.6 times per second.  Software interrupts are generated by
  138.       programs using the INT instruction and are used to access the
  139.       facilities of the BIOS and DOS such as writing to the screen or
  140.       reading input from the keyboard buffer.  There are a maximum of 256
  141.       different interrupts and the first 1K bytes of memory on a PC holds
  142.       the table of four byte Interrupt vectors which are pointers to the
  143.       code that services each interrupt.
  144.  
  145.       2.2 Memory Allocation
  146.       ---------------------
  147.  
  148.       A second feature is memory allocation.  This is managed by DOS and
  149.       programs and subsystems within DOS can request blocks of a given
  150.       size.  Memory is allocated in multiples of 16 byte units known as
  151.       paragraphs and all pointers to memory blocks are in terms of
  152.       paragraphs.  This means that the 1Mbyte memory space of a PC can be
  153.       accessed via 2 byte(16 bit) pointers know as segment or paragraph
  154.       pointers.  Each block is preceded by a one paragraph header which
  155.       contains details of its owner and how many paragraphs long the
  156.       block is.
  157.  
  158.       2.3 TSRs
  159.       --------
  160.  
  161.       A major subsystem in DOS is the program loader (EXEC).  This works
  162.       by asking DOS for a block of memory to hold a copy of the DOS
  163.       Environment (shown by the DOS SET command) and then for a second
  164.       block to hold program itself.  The program block starts with
  165.       256byte (Hex 10 paragraphs) Program Segment Prefix (PSP) which is
  166.       used by DOS to control the running of the program.  A normal
  167.       program releases all its memory on termination.  Those that dont
  168.       are known as Terminate and Stay Resident (TSR) programs and these
  169.       exit back to DOS via a special call which leaves them resident in
  170.       memory.
  171.  
  172.  
  173.       Once a TSR has returned control back to DOS it needs some mechanism
  174.       to reactive itself.  It does this by linking in to an interrupt,
  175.       such as the timer if it needs regular activation, or the keyboard
  176.       if just wants to react to certain key presses.  It does this by
  177.       copying the contents of the appropriate Interrupt vector and
  178.       replacing it by a pointer to an interrupt handler in its own code.
  179.  
  180.       Thus when the Interrupt is activated the TSR code is executed and
  181.       usually this ends by jumping via the original Interrupt vector to
  182.       the previous interrupt handler.  It is therefore quite possible for
  183.       several TSRs to form a chain of programs that are activated by one
  184.       interrupt.  Thus removing a TSR from the middle of such a chain is
  185.       rather difficult without the cooperation of the preceding TSR in
  186.       the chain since there is no way of knowing where the latter has
  187.       stored the next Interrupt vector in the chain.
  188.  
  189.       Before loading any program LOADSYS notes down all the Interrupt
  190.       vectors.  For a TSR it then loads and runs the program.  On
  191.       termination any changes to the Interrupt vectors are stored in
  192.       small block of memory which will be referred to as the LOADSYS
  193.       Control Block.  This Control Block enables LOADSYS to know which
  194.       TSRs it has loaded and contains sufficient information to allow
  195.       them to be unloaded subject to certain conditions.
  196.  
  197.       In theory unloading a TSR simply requires the Interrupt vectors to
  198.       be returned to their original values and the memory occupied by the
  199.       TSR to be released.  However if another TSR has added itself to the
  200.       Interrupt chain LOADSYS has no means of telling the preceding
  201.       Interrupt handler the new next member in the chain.  If this
  202.       happens then LOADSYS is unable to unload the TSR.
  203.  
  204.       To get round this problem the /r option on LOADSYS redirects the
  205.       Interrupt vectors used by a program via the Control Block.  Thus
  206.       any further program will record an Interrupt vector that points to
  207.       the Control block so that by judicious changing of pointers within
  208.       the Control Block a program can be unloaded leaving the Control
  209.       Block to take care of its position in the Interrupt vector chain.
  210.       Only when it is the start of all the Interrupt vector chains is the
  211.       Control Block removed from them and deleted.  Because it may have a
  212.       life much longer than a TSR the Control Block is kept at the top of
  213.       the DOS memory - just before 640K on most PCs.  TSRs are loaded at
  214.       the bottom of memory as are normal programs.
  215.  
  216.       2.4 Device Drivers
  217.       ------------------
  218.  
  219.       Device Drivers are treated in much the same way except that they
  220.       have to be linked in to a series of lists within DOS.  This becomes
  221.       especially tricky for Block Device Drivers (further details in the
  222.       DOS Technical Reference).  A typical Block Device Driver is the
  223.       virtual disc driver VDISK.SYS.  Because some of the information is
  224.       held in a table rather than a chain it is very difficult to remove
  225.       all but the last Block Device Driver so that is all that is
  226.       allowed.  Fortunately most Device Drivers are of the Character type
  227.       which is much easier to deal with.
  228.  
  229.  
  230.       Because Device Drivers are normally loaded when DOS is booted up
  231.       they sometimes make assumptions about the state of the machine.
  232.       VDISK, for example, checks the memory it has been loaded into and,
  233.       if it finds traces of itself, assumes that a warm start of the
  234.       machine (Ctrl+Alt+Del) has occurred and that the virtual disc has
  235.       all its files intact.  It can do this because VDISK.SYS is always
  236.       loaded into the same area of memory at boot up.  Unfortunately for
  237.       LOADSYS this cannot be assumed so the feature is inhibited by
  238.       clearing the memory before any Device Driver is loaded and also the
  239.       BIOS flag indicating a warm start is unset.
  240.  
  241.       2.5 I/O Port and Memory Modification
  242.       ------------------------------------
  243.  
  244.       When a program is unloaded by LOADSYS it may be necessary to close
  245.       down a communications card or disable an interrupt in order to
  246.       avoid crashing the machine.  The /p option permits this by allowing
  247.       an I/O Port to have its value reset when a program is unloaded.
  248.       The entire value or just selected bits may be reset.  The /p option
  249.       also allows I/O Port values to be displayed thus facilitating the
  250.       setting up of this option.  I/O Port usage can be found in the
  251.       appropriate Technical Reference manuals and great care is needed in
  252.       setting them.  Note also that reading some ports clears the setting
  253.       and this could adversely affect a program using that port.
  254.  
  255.       The /m option provides the same facility for inspecting and
  256.       changing memory locations.
  257.  
  258.       2.6 LOADSYS features
  259.       --------------------
  260.  
  261.       Both TSR and Device Drivers loaded with the /r option can be
  262.       disabled (/d) by removing them from the Interrupt vector chains and
  263.       the DOS lists.  The program is not removed from memory and can be
  264.       enabled (/e) again.  It will preserve its previous state thus VDISK
  265.       will still contain any files that had been written to it.
  266.  
  267.       Whilst the majority of programs will add themselves into the chain
  268.       of Interrupt vectors at initialisation and thus be noted by LOADSYS
  269.       there are some exceptions.  LOADSYS therefore checks before
  270.       unloading or disabling a program to see if there are any extra
  271.       Interrupt vectors pointing into it.  If so then the action is
  272.       refused and an indication given how this limitation can be overcome
  273.       if the Interrupt is not actually being used by the program.  The /i
  274.       option allows such Interrupts to be specified at load time and thus
  275.       overcomes the problem.
  276.  
  277.       Another variation on Interrupts is when loading a program can
  278.       change an Interrupt vector yet it does not point into the program.
  279.       This is referred to as a side effect and is reported by LOADSYS
  280.       unless the /os option is given. Specifying such Interrupts via the
  281.       /i option allows them to be reset when the program is unloaded.
  282.  
  283.  
  284.       When several TSRs or Device Drivers are loaded and then some are
  285.       unloaded it is possible to leave gaps in memory when the unloading
  286.       is not last in - first out.  This should be avoided by loading
  287.       programs in the right order but should this not be possible then
  288.       LOADSYS with the squeeze (/q) option can move programs down memory
  289.       to fill the gaps.  This is VERY DANGEROUS since it assumes the
  290.       programs are relocatable at run time and this is not the case for
  291.       the majority.  ANSI.SYS works but VDISK does not and should a
  292.       failure occur then the machine will probably crash.  A much safer
  293.       way is to unload and the load the program again though note that
  294.       this will reinitialise it.  Any program that is going to be moved
  295.       must be loaded with the /f (free) option.
  296.  
  297.       2.7 Loading at different positions in memory
  298.       --------------------------------------------
  299.  
  300.       Similarily it is possible to load programs into the top of memory
  301.       by using the /t option.  This is not as useful as it might be due
  302.       to most programs reducing their memory requirements when they
  303.       become resident and discard their initialisation code.  Thus there
  304.       is likely to be an unusable gap at the top of memory.  A second
  305.       problem is that programs loaded into the bottom of memory are given
  306.       all the available free memory.  When they are loaded at the top of
  307.       memory this is not practicable so they are loaded in the minimum
  308.       specified.  This is frequently not enough so the /z option can
  309.       specify the size of memory to be used for loading.  Loading the
  310.       program in low memory with /z and no value will give an indication
  311.       of its requirements.
  312.  
  313.       A subsiduary problem is the location of the programs stack.  If
  314.       this is not explicitly defined in the program then it is initially
  315.       located at 64K ie the end of the .COM program address space.  When
  316.       a program is loaded at the top of memory this would waste a lot of
  317.       memory so a 32 byte stack is added onto a programs stated size
  318.       unless the /z option has been used when the stack is placed at the
  319.       end of the program address space.  Note that even when a program
  320.       sets up its own stack there must be a valid stack available when
  321.       the program starts in order to cope with timer interrupts and the
  322.       like that occur before the program has setup its own stack.  It
  323.       takes 24 bytes to store the state of the machine.
  324.  
  325.       Note that when a program is loaded at the top of memory the Control
  326.       Block is put into the bottom of memory.  However if the /oa option
  327.       is given then the Control Block is put in the same part of memory
  328.       as the program.
  329.  
  330.       Programs may also be loaded at a specified point in memory by using
  331.       the /w option.  This can either be within the DOS 640K space or in
  332.       any other memory below 1 Mbyte.  The latter can be memory held on
  333.       device cards (ie the monochrome screen on a two screen PC) or any
  334.       memory space obtained from memory mapping software or hardware -
  335.       see next section.  Care is needed to make sure nothing else uses
  336.       the memory whilst the program is loaded into it.
  337.  
  338.  
  339.       An alternative way to use memory above 640K is to extend the DOS
  340.       memory block chain into this region using the /b option and in this
  341.       case LOADSYS will load programs in this area in preference to
  342.       normal low memory.
  343.  
  344.       Programs can also be loaded at an address greater (/wg) or less
  345.       than (/wl) that specified.
  346.  
  347.       When programs can also be moved to and from the top of memory using
  348.       the /q option and the /t & /w options determine where it is
  349.       located.
  350.  
  351.       2.8 Upper Memory
  352.       ----------------
  353.  
  354.       Having developed a program loader one obvious extension is to load
  355.       programs in the memory gaps between 640K and 1Mbyte.  To do this
  356.       you need some form of memory mapping which gives the impression
  357.       that such memory exists.  Due to its memory mapping hardware this
  358.       is possible on 386 PCs and the present implementation is targeted
  359.       at these.  There are several commercial products that do this such
  360.       as QEMM and 386MAX and under DOS 5 the DOS=UMB command in
  361.       CONFIG.SYS in conjunction with HIMEM.SYS and EMM386.SYS provides a
  362.       similar facility.  LOADSYS does not seek to copy them since this
  363.       would need a lot of effort which cannot be justified.  Rather it
  364.       seeks to provide a poor mans halfway house by interfacing to what
  365.       is already available.  These are the LIM v3.2, EMS/LIM v4.0 and XMS
  366.       v2.0 interfaces.
  367.  
  368.       Before explaining what LOADSYS supports it is perhaps useful to
  369.       explain the different types of memory for those who are unclear in
  370.       this area.  The original PC was based on a 16 bit processor which
  371.       had an address size of 20 bits and can thus address upto 1Mbyte of
  372.       memory.  When it designed the PC, IBM decided to only use the first
  373.       640K of this address space for programs and to reserve the
  374.       remainder for the system side of the PC.  Thus the ROMs that
  375.       provide the BIOS (Basic Input Output System), BASIC and support for
  376.       new features such as EGA cards are all situated in the 640K to
  377.       1Mbyte gap.  The screen buffers are also in this region.  The
  378.       important point is that the whole of this area is not used.  There
  379.       are gaps in the address space that are not occupied and it is the
  380.       exploitation of this allows the PC to gain extra memory.
  381.  
  382.       This area of the address space between 640K and 1Mbyte will be
  383.       referred to as upper memory - the memory below 640K being referred
  384.       as lower memory.  The crucial thing to note is that most code
  385.       will execute wherever it is situated in lower or upper memory.
  386.       Thus if you can somehow install memory in the gaps is this area
  387.       then it has the potential of being used to run programs.
  388.  
  389.  
  390.       2.9 Extended Memory
  391.       -------------------
  392.  
  393.       The original address limitation of 1Mbyte was removed by the
  394.       arrival of the 286 processor in the PC/AT and its various clones.
  395.       Whilst it is possible to address up to 16Mbytes with this machine
  396.       you have to switch it into a different addressing mode and then you
  397.       cannot run DOS or any of the programs that run under it without
  398.       major modification.  Switching back to the original mode is also a
  399.       tortuous process which involves rebooting the machine!  The memory
  400.       that is situated above 1Mbyte is referred to as Extended memory
  401.       because it is an extension of the original 1 Mbyte address space.
  402.       There is now a standard known as Extended Memory Specification
  403.       (XMS) v2.0 which defines how a system can manage not only memory
  404.       above 1 Mbyte but also the upper memory between 640K and 1 Mbyte.
  405.  
  406.       2.10 Expanded Memory
  407.       --------------------
  408.  
  409.       A second solution, which can also be used on the original 8088
  410.       based PC/XT machines, is to add extra memory and provide a special
  411.       mechinism to access it.  This is done by the hardware mapping 16K
  412.       byte areas (called pages) of this memory onto a suitable gap in the
  413.       upper memory address space.  This window onto the extra memory can
  414.       be moved around thus giving access to it all but only in 16K pages.
  415.  
  416.       The technique is known as bank switching and the memory is referred
  417.       to as Expanded memory.  The standard defining the mapping interface
  418.       was originally known as LIM and there are two versions, 3.2 which
  419.       limits you to four adjacent 16K byte pages in a 64K frame, and 4.0
  420.       which allows you to use any 16K gap in upper memory as a page.  The
  421.       latest definition is the Expanded Memory Specification (EMS) 4.0.
  422.  
  423.       2.11 Expanded Memory Managers
  424.       -----------------------------
  425.  
  426.       A final twist to the senario is that the 386 processor has much
  427.       better memory management and this permits software to be written
  428.       which makes Extended memory (ie that above 1Mbyte) appear to be
  429.       Expanded memory.  Such Expanded Memory Managers (EMM) can thus be
  430.       used to fill all the gaps in the upper memory area.  Some also
  431.       implement the XMS interface to upper memory.  The technique used
  432.       requires the machine to be run is a special mode known as Virtual
  433.       8086 and this can give interesting problems.
  434.  
  435.       Several products for 386 machines provide these features.  One of
  436.       simplest is EMM386.SYS supplied by Microsoft either with DOS 4, or
  437.       a smaller but inferior version with Windows 3, both of which
  438.       provide a EMS 4.0 interface to the Extended memory.  More
  439.       sophisticated systems are QEMM and 386MAX which combine a EMS 4.0
  440.       interface, XMS and their own memory management which permits
  441.       programs to be loaded into upper memory and also allows the EMS 4.0
  442.       interface to be used.  DOS 5 in conjunction with HIMEM.SYS and its
  443.       version of EMM386.SYS provides similar facilities.  Compaq machines
  444.       have CEMM which is version of the early Microsoft software.  Any
  445.       machine with an Expanded memory board and driver can also be used.
  446.  
  447.       Note that PC-DOS 4 does not include EMM386 and only the Windows
  448.       and DOS 5 versions will run on a PS/2.
  449.  
  450.  
  451.       2.12 LOADSYS Support of EMMs
  452.       ----------------------------
  453.  
  454.       LOADSYS therefore provides the ability to interface onto an EMM
  455.       which conforms to the LIM 3.2 or EMS/LIM 4.0 specification.  It can
  456.       use any of the memory pages up to 1Mbyte via the /xp option which
  457.       prevents any other programs from using this interface or /xl which
  458.       allows LIM access as well.
  459.  
  460.       LOADSYS can also interface onto an XMS v2.0 interface which
  461.       provides upper memory via the /xx option.
  462.  
  463.       Under DOS 5 where HIMEM.SYS is used with the CONFIG.SYS command
  464.       DOS=UMB,HIGH the LOADSYS will automatically load programs into
  465.       upper memory.
  466.  
  467.       On a 386 machine with a VGA most EMMs can supply 160K of upper
  468.       memory.  With sophisticated systems such as QEMM this can increase
  469.       to 192K and if graphics are not required then 240K is possible.
  470.       The only exception in the PS/2 where the Advanced BIOS reduces all
  471.       these values by 64K.  The total available memory is reduced by the
  472.       low memory occupancy of the EMM which in the case of QEMM is
  473.       2Kbytes and MS-DOS 4 EMM386 is 37Kbytes. The Windows 3 version of
  474.       EMM386 which must be run alongside HIMEM uses only 10K bytes but
  475.       note this does not support DMA so BICC 16 bit & MCA drivers wont
  476.       work under it. This limitation is not shared by the DOS 5 version.
  477.  
  478.       When upper memory is available LOADSYS will use it by default.
  479.  
  480.       LOADSYS detects the use of Expanded, Extended and HMA memory by a
  481.       program and release this memory when the program is unloaded. It
  482.       will also note any extension to the chain of XMS drivers and reset
  483.       it at unloading provided it is the first in the chain.
  484.  
  485.       2.13 Moving system code and data
  486.       --------------------------------
  487.  
  488.       Various parts of the DOS system can be moved by LOADSYS and if
  489.       upper memory is present this will be used.  The buffers specified
  490.       in the CONFIG.SYS line BUFFERS= can be reduced to 1 and additional
  491.       buffers allocated by LOADSYS.
  492.  
  493.       COMMAND.COM, the DOS Environment and the PS/2 Extended BIOS Data
  494.       Area can also be moved into upper memory as can the buffer used for
  495.       running a BAT file.  The latter avoids memory fragmentation when
  496.       TSR's and Device Drivers are loaded and unloaded via BAT files.
  497.  
  498.       2.14 Summary
  499.       ------------
  500.  
  501.       In summary LOADSYS is a set of tools for loading, unloading and
  502.       positioning programs in memory.  It is very much a suck it and see
  503.       process for the expert facilities since a lot depends on how a
  504.       system has been programmed.  However once a methodology has been
  505.       proven it should work reliably.
  506.  
  507.  
  508.  
  509.       3.  LOADSYS
  510.       ===========
  511.  
  512.       3.1 Description
  513.       ---------------
  514.  
  515.       The format of a call to LOADSYS is:
  516.  
  517.             LOADSYS  /options filename params
  518.  
  519.       which loads device driver or TSR called filename and runs it with
  520.       parameters params.  /options are optional LOADSYS parameters and
  521.       are described below.  They must precede the filename.  Filename can
  522.       be a full pathname or a file in the current directory or a PATH
  523.       directory.  Filename need not have an extension in which case the
  524.       first file ending in .SYS, .COM or .EXE will be used. (Notes 1,5 & 32).
  525.  
  526.       The following options modify the action taken:
  527.  
  528.         ?  display this help information
  529.         a  give additional information on what is being done (Note 2)
  530.         h  display this help information
  531.         l  list the TSRs/Device Drivers loaded by LOADSYS. (Note 2)
  532.         n  TSRs/Device Drivers must always be referred to by name.
  533.            (Note 5)
  534.         r  redirect Interrupts to allow disable/enable and guarantee
  535.            unloading will work. (Notes 3 and 14)
  536.         s  silent flag - no reporting is done except for a warning
  537.            or major error. The option /ss surpresses warnings. (Note 30)
  538.         u  unload filename or last TSR/Device Driver loaded. /ur unloads
  539.            all LOADSYS programs or until a named program is found. (Note 4)
  540.        xh  record current directory as the home directory. (Note 29)
  541.       !xh  return to home directory.
  542.  
  543.       Examples are:
  544.  
  545.         loadsys ansi       Load ANSI.SYS if in a directory in the Path
  546.         loadsys /u ansi    Unload ANSI.SYS
  547.         loadsys /u         Unload last TSR or Device Driver to be loaded
  548.         loadsys /l         List TSRs/Device Drivers loaded via LOADSYS
  549.         loadsys /r ansi    Load ANSI.SYS so it can disable/enable and
  550.                            guarantee unloading
  551.         loadsys /d ansi    Disable ANSI.SYS but dont unload it
  552.         loadsys /e ansi    Enable disabled ANSI.SYS
  553.         loadsys /xh        Record current directory as home
  554.         loadsys /!xh       Return to home directory
  555.  
  556.  
  557.       The following options are for expert use only - some may crash the PC.
  558.       α is a hexadecimal number, δ is a decimal number, ß is a bit value
  559.       (0,1 or x - x means dont care):
  560.  
  561.         *  the remaining text on the command is a comment. (Note 35)
  562.         1  filename refers to the first program of this name to be
  563.            loaded and not the last. (Note 5)
  564.         2  force second copy of TSR or Driver to be loaded. (Note 12)
  565.         3  do INT 3 prior to running program. (Note 16)
  566.         b  reserve the last paragraph of memory for LOADSYS so
  567.            DOS memory chain can be extended to upper memory. (Note 19)
  568.        !b  reduce DOS memory chain to lower memory.
  569.         bαααα:αααα  add memory at αααα size αααα paragraphs to DOS
  570.            memory chain. (Note 19)
  571.         d  disable a TSR/Device Driver - must have loaded with /r
  572.         e  enable disabled TSR/Device Driver
  573.         f  load program as free to be moved in memory. (Note 9)
  574.         iαα  record interrupt αα as chained into at a later date
  575.            or not to be rediredted. (Note 14)
  576.         lb list memory blocks. (Note 2)
  577.         ld list memory blocks. (Note 2)
  578.         lf list DOS file table. (Note 2)
  579.         lp list program memory blocks. (Note 2)
  580.         ls list system features. (Note 2)
  581.         lx list XMS memory chain. (Note )
  582.         mαααα:αααα            display value of memory byte αααα:αααα
  583.         mwαααα:αααα           display value of memory word αααα:αααα
  584.         mαααα:αααα=αα         reset memory byte αααα:αααα to αα
  585.         mwαααα:αααα=αααα      reset memory word αααα:αααα to αααα
  586.         mαααα:αααα=10#δδδ     reset memory byte αααα:αααα to
  587.                               decimal value δδδ
  588.         mwαααα:αααα=10#δδδδδ  reset memory word αααα:αααα to
  589.                               decimal value δδδδδ
  590.         mαααα:αααα=2#ßßßßßßßß reset memory byte αααα:αααα to
  591.                               bit values ßßßßßßßß
  592.         mwαααα:αααα=2#ßßßßßßßßßßßßßßßß   reset memory word αααα:αααα to
  593.                                          bit values ßßßßßßßßßßßßßßßß
  594.                                          (Note 15)
  595.         oτ  override default options where oτ is one of:
  596.          oa  place control block adjacent to program instead of other
  597.              end of memory. (Note 10)
  598.          ob  dont extend DOS memory chain into /xl, /xp or /xx supplied
  599.              memory. (Note 23)
  600.          od  force file to be loaded as a Device Driver. (Note 7)
  601.          oe  force Environment copy to be released. (Note 8)
  602.          of  dont Flush Device Driver before unloading. (Note 18)
  603.          oh  load program into HMA if available. (Note 34)
  604.          oi  use DOS internal loader instead of the one in LOADSYS.
  605.              (Note 13)
  606.          ok  keep LOADSYS where it is, dont move up memory when loading
  607.              (Note 33)
  608.          ol  force LOADSYS to load in lower memory despite upper memory
  609.              being present. (Notes 6 and 19)
  610.          om  dont take note of Expanded, Extended and HMA memory used
  611.              by the program. (Note 32)
  612.  
  613.  
  614.  
  615.          oo  overlay program out if loads another program. (Note 28)
  616.          oq  quit if a warning occurs. (Notes 31 and 6)
  617.          or  dont enable ROM shadowing at unload or disable at loading.
  618.              (Note 21)
  619.          os  dont report Interrupt changes that dont point to me
  620.              (Side Effects) (Note 17)
  621.          ot  force file to be loaded as a TSR. (Note 7)
  622.          ou  load only into upper memory (Note 6)
  623.          ov  notify that program may switch to Virtual 8086 mode
  624.              and switch off ROM shadowing. (Note 21)
  625.         pαααα, pwαααα, pαααα=αα, pwαααα=αααα, etc  display or reset
  626.                         8 and 16 bit I/O Port αααα in same way as /m
  627.                         (Note 15)
  628.         q   squeeze memory by moving programs loaded with /f option down
  629.             memory (up if /t) to remove gaps. (Note 9)
  630.         t   load or move to top of memory. (Note 6)
  631.         uh  unload home directory (/xh) record. (Note 29)
  632.         wαααα   Load program at segment αααα in memory. (Note 6)
  633.         wgαααα  Load program at a memory segment greater than or
  634.                 equal to αααα. (Note 6)
  635.         wlαααα  Load program at a memory segment less than αααα. (Note 6)
  636.         xbδ increase number of DOS file Buffers to δ. (Note 24)
  637.        !xb  decrease DOS file buffers to original CONFIG.SYS value
  638.         xc  move COMMAND.COM. (Note 25)
  639.         xd  allow DOS access to upper memory. (Note 19)
  640.        !xd  reduce DOS access back to lower memory.
  641.         xe  move DOS Environment. (Note 25)
  642.         xf  remove memory fragmentation caused by LOADSYS (Note 20)
  643.        !xf  allow memory fragmentation. (Note 20)
  644.         xl  as xp but allow 4 pages for LIM access. (Note 23)
  645.         xlδ as xp but allow δ pages for LIM access.
  646.        !xl  release upper memory if not in use.
  647.         xp  use all memory pages upto 1Mbyte being offered by a
  648.             Memory Manager via the EMS or LIM interface. (Note 23)
  649.        !xp  release upper memory if not in use.
  650.         xr  switch on ROM shadowing. (Note 22)
  651.        !xr  switch off ROM shadowing.
  652.         xt  move PS/2 Extended BIOS data area. (Note 26)
  653.         xw  move DOS working buffer for BAT files. (Note 27)
  654.         xx  use all memory  upto 1Mbyte being offered by a
  655.             Memory Manager via the XMS interface. (Note 23)
  656.         xxαααα  use only αααα paragraphs of upper memory from XMS
  657.        !xx  release XMS upper memory if not in use
  658.         zαααα Load program in block of memory size αααα (hex) paragraphs.
  659.             (Note 11)
  660.  
  661.  
  662.       Examples are:
  663.  
  664.         loadsys /d ansi    Disable ANSI.SYS but dont unload it
  665.         loadsys /e ansi    Enable disabled ANSI.SYS
  666.         loadsys /f ansi    Load ANSI.SYS so it can be moved in memory
  667.         loadsys /q ansi    Move ANSI.SYS down memory filling any gaps
  668.         loadsys /qt ansi   Move ANSI.SYS to top of available memory
  669.         loadsys /z ansi    Load ANSI.SYS to determine minimum load size
  670.         loadsys /t /z6B ansi   Load ANSI.SYS at top of available memory
  671.                                in 6B paragraphs
  672.         loadsys /z6B /w9000 ansi   Load ANSI.SYS at segment 9000 in
  673.                                    6B paragraphs
  674.         loadsys /z6B /wgC800 ansi  Load ANSI.SYS at segment greater
  675.                                    than C800 in upper memory
  676.         loadsys /2 vdisk   Load second virtual disk driver
  677.         loadsys /i15 himem Load HIMEM.SYS and note INT 15 as this is
  678.                                 linked into after startup.
  679.         loadsys /mw40:72=1234  Set memory word 40:72 to 1234
  680.         loadsys /p2D4      Display value of I/O port 2D4
  681.         loadsys /p2D4=2#1xxxxxx0 pc3270  Load PC3270.COM and reset I/O port
  682.                            2D4 at unload by setting bit 7 and clear bit 0
  683.         loadsys /xp        Use all upper memory provided by EMM.
  684.         loadsys /!xp       Release all EMM provided memory
  685.         loadsys /xl2       Use all available EMM memory leaving
  686.                            2 pages for LIM access.
  687.         loadsys /xx        Use all available XMS provided upper memory
  688.         loadsys /xx1000    Use 64K XMS upper memory
  689.         loadsys /bD000:1000  Add 64k memory block at D000 to DOS memory chain
  690.         loadsys /xb20      Increase DOS buffers to a total of 20
  691.         loadsys /xb20 /wgC800  Increase DOS buffers to a total of 20
  692.                                using upper memory above C800.
  693.         loadsys /xcou      Move COMMAND.COM but only if upper memory available
  694.         loadsys /xf        Remove memory fragmentation prior to using Windows 3
  695.  
  696.  
  697.       3.2 Notes
  698.       ---------
  699.  
  700.       1.  LOADSYS acts just like the normal DOS command processor in
  701.       searching for a command except that it adds the .SYS file extension
  702.       onto its list of acceptable filenames and ignores .BAT files.  Thus
  703.       it searches the current directory and then each directory defined
  704.       by the PATH environment varaible.  When no extension is given to
  705.       the filename each directory is searched first for .SYS extension,
  706.       then a .COM and finally a .EXE.
  707.  
  708.       2.  LOADSYS lists the TSRs and Device Drivers in the order that
  709.       they were loaded.  The /a option will give further details.  If the
  710.       /u option is given without a filename then the programs will be
  711.       unloaded in reverse order starting from the bottom of the list.
  712.  
  713.       If the /lb option is given then LOADSYS lists the memory blocks and
  714.       gives details of their usage.  Adding /a shows blocks marked as the
  715.       end of the DOS chain with <EOC> and summerises free blocks.  It
  716.       also checks for blocks of memory (orphans) that have not been
  717.       released when their owners terminated and indicates any LOADSYS
  718.       control blocks that are still in Interrupt chains.  The RAL utility
  719.       PCCONFIG with the /b option will also give additional details of
  720.       the memory blocks but note that it gives the address of the 16 byte
  721.       header block which precedes each memory block.  This is one less
  722.       than the address given by LOADSYS which is the data.  Note that
  723.       only PCCONFIG version 2.0 and later can interpret LOADSYS control
  724.       blocks.
  725.  
  726.       If the /ld option is given LOADSYS lists the DOS Device Driver
  727.       chain and the list of Block Device Drivers that are present - the
  728.       latter are usually the various disc drives.  Adding the /a option
  729.       in this case gives further details of the Block Device Drivers and
  730.       is for diagnostic purposes.
  731.  
  732.       If the /lf option is given LOADSYS lists the DOS File Table which
  733.       is the internal table of all the files that are open.
  734.  
  735.       If the /lp option is given LOADSYS lists only those memory blocks
  736.       containing programs.
  737.  
  738.       If the /ls option is given LOADSYS lists the various relevant system
  739.       features including available free memory.
  740.  
  741.       3.  LOADSYS normally notes the Interrupt vectors used by a program
  742.       and repatches back the old values when the program is unloaded.
  743.       However this is not possible if a further program has patched
  744.       itself in to one of the interrupts.  LOADSYS gets round this by
  745.       pointing the interrupts used by a program to its Control Block
  746.       which redirects them to the correct place in the program.  When the
  747.       program is unloaded the addresses in the Control Block are changed
  748.       back to the orginal Interrupt values so the program can be deleted.
  749.       The Control Block is only deleted when LOADSYS can make the correct
  750.       changes to the Interrupt pointers in DOS and this is checked at
  751.       each invocation.  The /lb option gives details of any such blocks.
  752.  
  753.  
  754.       The Control Block is also used when a TSR or Device Driver is
  755.       Disabled by LOADSYS since this involves removing the program from
  756.       any Interrupt chains that it may be in.
  757.  
  758.       Note that this option will give problems with those programs that
  759.       use an interrupt vector to see if they, or an auxiliary program,
  760.       are already loaded.  Examples of this are DOS 2.1 PRINT.COM, the
  761.       RAINBOW Communications software and Packet Driver ethernet drivers.
  762.  
  763.       4.  LOADSYS is unable to unload any program whose Interrupt vectors
  764.       have been repatched unless it was loaded with the /r option.  It is
  765.       also unable to unload any Block Device Driver that is not the last
  766.       Block Device.
  767.  
  768.       LOADSYS will also refuse to unload a program when unrecorded
  769.       Interrupt vectors in the range 0 - 7f point into it.  This could
  770.       warn that a program has chained into an Interrupt after it was
  771.       loaded, in which case use /i to specify the interrupt at load time,
  772.       or that an interrupt has not been reset by a previous program and
  773.       this program happens to be in the memory pointed to by the Interupt
  774.       vector.  The option /uu will force unloading to continue.
  775.  
  776.       If the /ur option is given then all LOADSYS programs are unloaded
  777.       starting from the last entry and going back up the list stopping
  778.       only if a program had been loaded with the /n option or an error
  779.       occurs.  If a filename is also given the unloading starts at the
  780.       last program of that name to be loaded (unless the /1 option is
  781.       given) and continues back up the list.  See also note 5.
  782.  
  783.       LOADSYS can also load and unload Expanded Memory Management (EMM)
  784.       programs such as EMM386 and QEMM.  To unload these programs the
  785.       option /uu must be given since this is quite dangerous and requires
  786.       a Protection Violation to be generated.  This usually causes the
  787.       EMM to give an error message and invite the user to respond with an
  788.       indication of what to do next.  The usual reply is C to continue
  789.       which will cause LOADSYS to finish off the unloading of the EMM.
  790.       This does not work for 386MAX, since this appears to have no
  791.       aborting facilities.  Note that LOADSYS will refuse to unload an
  792.       EMM if the memory is still in use and the /!xp or /!xl option has
  793.       usually to be given on a previous call to LOADSYS.
  794.  
  795.       5.  If no name is given LOADSYS will assume the last TSR or Device
  796.       Driver it loaded is to be acted upon by the unload, squeeze or
  797.       disable/enable options.  If however it was loaded with the /n
  798.       option then this requires the program to be named before any action
  799.       is taken.  Note that this provides a blocking mechanism for the /ur
  800.       option (unload repeat).
  801.  
  802.       If a program has been loaded more than once then the last one
  803.       loaded will be the one acted upon.  This can be overridden by the
  804.       /1 option which causes the first one loaded to be acted on.  If the
  805.       name ends in * then this acts as a wildcard and a match is done on
  806.       any preceding characters.  Again it is the last matching entry in
  807.       loading order that is acted upon unless the /1 option is given.
  808.       Note that a name of just * will select the last program to be
  809.       loaded.
  810.  
  811.  
  812.       The /n option may be given on its its own and this forces the last
  813.       program loaded by LOADSYS to be marked as requiring it to be named.
  814.       Thus a BAT file which can optionally use TSRs or Device Drivers can
  815.       ensure that a LOADSYS /ur will remove them all if it first issues a
  816.       LOADSYS /n to protect any other programs LOADSYS has loaded.
  817.  
  818.       6.  LOADSYS will load the TSR or Device Driver by default in low
  819.       memory (as per a normal program) and put the Control Block at the
  820.       top of DOS memory.  The /t option reverses this but will leave
  821.       significant gaps at the end of memory.  In this case the /z option
  822.       will probably be required to specify the memory needed by the
  823.       program.  Warning messages are given when LOADSYS makes assumptions
  824.       regarding the positioning of the programs stack.
  825.  
  826.       If however upper memory has been made available via the /b /xp or
  827.       /xl options or under DOS 5 via the DOS=UMB command in CONFIG.SYS
  828.       then this will be used in preference to lower memory.  This can be
  829.       overridden by giving the /ol option.  The /ou option forces loading
  830.       in upper memory causing a failure if it is not present.
  831.  
  832.       The /oa option causes the Control Block to be loaded in the same
  833.       area of memory as the program.
  834.  
  835.       If the /wg or /wl options are given the program and its Control
  836.       Block are loaded within the address range specified. Note that the
  837.       default settings are:
  838.  
  839.         /wg0000 /wlA000     ; range 0 to 640K
  840.  
  841.       unless upper memory is present when in the absence of the /ol
  842.       option they are reset to:
  843.  
  844.         /wgA000 /wlFFFF     ; range 640K - 1M
  845.  
  846.       Note that /wg and /wl addresses are compared with the starting
  847.       paragraph of a suitable free block so that any block spanning the
  848.       address will be rejected for /wg and accepted for /wl.  Thus they
  849.       are only useful where there is more than one free block available
  850.       and the /w option should be used for more precise location.  The /t
  851.       and /oa options operate as before.  If it is not possible to obtain
  852.       sufficient memory in the area specified the limits are relaxed
  853.       first, if it is available, to the whole of upper memory and then to
  854.       the whole of lower memory.  The aim is to load the program if at
  855.       all possible but this can be overriden by the /oq option which will
  856.       quit the loading if it is not possible in the area specified.
  857.  
  858.       Finally if the /w option is given (without the g or l qualifier)
  859.       then the program is loaded at that paragraph if free memory exists.
  860.       This can be anywhere upto 1 Mbyte and could for example be an
  861.       unused area of memory on a video card.  The Control Block and any
  862.       Environment copy are located in their normal places according to
  863.       any other relevent options such as /t /wl /wt or /ol.  The /oa
  864.       option causes the Control Block to be placed in the same part of
  865.       memory as the Environment. Failure to obtain the memory causes
  866.       the load to abort.
  867.  
  868.  
  869.       Giving the /a option will give further details including where
  870.       things are loaded.
  871.  
  872.       See also note 33.
  873.  
  874.       7.  LOADSYS assumes a TSR program ends in .COM or .EXE and a Device
  875.       Driver ends in .SYS.  Where this is not the case then the /od or
  876.       /ot options may be used to override this feature.  Be warned that
  877.       if you get it wrong then DOS will probably crash.
  878.  
  879.       Some TSRs also terminate as if they were normal programs (ie dont
  880.       execute the DOS Terminate and Stay Resident exit) and leave their
  881.       resident part in another block of memory.  The usual reason is when
  882.       they want to leave their code at the top of memory.  LOADSYS can
  883.       cope with this case provided the changed Interrupts point to the
  884.       new program location.
  885.  
  886.       If this is not the case LOADSYS will report that the program is not
  887.       a TSR and it will reset any interrupts that have been changed and
  888.       thus leave the TSR disabled.  If the program actually was a TSR
  889.       (and not a program infected by a virus) the solution is to give the
  890.       /ot option but be warned this can give problems as LOADSYS may be
  891.       unable to locate the programs memory block.
  892.  
  893.       8.  Some TSRs dont release their copy of the DOS Environment when
  894.       they become memory resident - LOADSYS gives a warning when this is
  895.       the case.  Where memory usage is critical LOADSYS can force the
  896.       Environment to be released and it patches the program into the
  897.       orginal copy.  Should the TSR subsequently access the Environment
  898.       then it will work provided access is via the pointer in the
  899.       programs PSP.  If however the program took a copy of the
  900.       Environment pointer then it may fail as this will now point to an
  901.       undefined area of memory.  Note that the Environment copy is often
  902.       held in the same block for each program invocation so you could
  903.       well get away with it.  Therefore use with care and be prepared for
  904.       disaster - it usually only saves about 100+ bytes so is maybe not
  905.       worth the risk.
  906.  
  907.       The normal place for loading the DOS Environment copy is below the
  908.       program itself. Thus if a program frees its Environment copy this
  909.       could leave a small gap. Whilst this will probably be reused by the
  910.       next programs Environment copy this can be avoided by using the /oe
  911.       option which will cause the Environment copy to be loaded at the
  912.       other end of memory from the program.
  913.  
  914.       9.  The /q option squeezes memory by moving the TSRs or Device
  915.       Drivers loaded with the /f option.  This implies the /r option so
  916.       can only be used on programs which allow interrupts to be
  917.       redirected or those that cannot are specified by /i.  Where the
  918.       programs are moved to follows the same rules as program loading
  919.       defined in Note 6.
  920.  
  921.  
  922.       Thus if only low memory is in use then a program at the bottom of
  923.       memory is moved down filling any gaps.  If the /t option is given
  924.       then the program is moved up to the top of memory.  Conversely if
  925.       the program was at the top of memory then the absense of the /t
  926.       option would cause it to be moved to the bottom memory.  Finally
  927.       for a program at the top of memory the /t option would move it
  928.       higher up if possible.
  929.  
  930.       If upper memory was available then the program would be moved into
  931.       that in accordance with same rules unless the /ol option was given.
  932.  
  933.       The /r option can also be given to repeat the operation in a
  934.       similar manner to /ur for unloading programs.
  935.  
  936.       This option is VERY DANGEROUS and only works on a few programs such
  937.       as ANSI.SYS and KEYB.COM.  It does not work on PRINT.COM,
  938.       VDISK.SYS, CED.COM to name just a few.  It would be very dangerous
  939.       to try this feature on a disc caching program!
  940.  
  941.       Note that some EXE programs have relocation tables which are
  942.       implemented on loading. Since these are not recorded then moving
  943.       such programs is not possible therefore the /f option is ignored
  944.       and an error message given.
  945.  
  946.       10.  LOADSYS Control Blocks are usually located at the opposite end
  947.       of memory to the program.  Thus for normal loading where the
  948.       program at the bottom of memory the Control Block is at the top of
  949.       memory (usually just below 640k) .  The /oa option forces the
  950.       Control Block to be located at the same end of memory as the
  951.       program ie adjacent to it.  This option is forced when loading
  952.       programs in low memory under 4DOS or when fragmentation (option
  953.       /xf) is not allowed.  See also Note 6.
  954.  
  955.       Control Blocks are allocated in paragraphs (16 bytes) and the
  956.       minimum size is 28 bytes for a Device Driver using no interrupts.
  957.       Recording an Interrupt takes 10 bytes, setting an I/O Port takes 4
  958.       bytes and setting memory 6 bytes.  Thus a TSR with upto 2
  959.       interrupts takes 48 bytes (3 paragraphs) and PRINT.COM with 9
  960.       interrupts takes 8 paragraphs.
  961.  
  962.       11.  When a program is loaded in low memory it is initially given
  963.       all the available free memory.  On termination when it becomes
  964.       memory resident it releases what it does not need.  When loading a
  965.       program at the top of memory (/t) or at a specified point (/w) the
  966.       minimum memory specified in the program header is used.  This is
  967.       frequently too small so /z can be used to give the correct value.
  968.       Note the units are hex paragraphs.
  969.  
  970.  
  971.       If /z is given without a value, ie followed by a space, LOADSYS
  972.       will load the program as normal and then give an estimate of the
  973.       minimum memory required to load it.  This is calculated by filling
  974.       the memory with zeroes and then searching from the end looking for
  975.       the first bytes that have been changed.  If this coincides with
  976.       where the stack is located then this is passed over and further
  977.       searching is done.  The value finally suggested includes an
  978.       allowance for the stack.  There is no guarantee that this value is
  979.       correct but it gives a starting value for tests.  Note that the
  980.       loaded size shown on termination is the final memory requirement of
  981.       the program and is usually smaller that the load size due to the
  982.       initialisation code having been discarded.
  983.  
  984.       Thus the recommended procedure is to load the program with the /z
  985.       option and no value in low memory which will give the estimated
  986.       value for /z which can then be used for loading elsewhere in
  987.       memory.  Note that if a program is run with too small a /z value
  988.       then the program will overwrite the DOS memory block control header
  989.       and crash the system with the message:  Memory Allocation Error.
  990.  
  991.       12.  LOADSYS will normally refuse to let you load a second copy of
  992.       a TSR or Device Driver.  However for cases where this is valid such
  993.       as a second Virtual Disc the /2 option overrides this restriction.
  994.  
  995.       13.  LOADSYS has its own internal loader which it uses instead of
  996.       the one available via DOS.  The latter one may be accessed by using
  997.       the /oi option and is provided just in case a bug in the LOADSYS
  998.       loader prevents a program from loading or running.  It is not
  999.       recommended that this option is used for loading programs at the
  1000.       top of memory (/t) as it needs a minumum of 64k bytes thus leaving
  1001.       a large gap.  It is also not able to load TSRs at a given point or
  1002.       with a given size and any failure is likely to crash the machine.
  1003.  
  1004.       14.  LOADSYS only records those interrupts that are changed when a
  1005.       program is first loaded.  However some programs such as HIMEM.SYS
  1006.       chain into Interrupt vectors after they have been loaded.  The /i
  1007.       option tells LOADSYS to also record these interrupts.
  1008.  
  1009.       In order to check for such cases LOADSYS checks when a program is
  1010.       unloaded to see if any unrecorded Interrupt vectors point to it.
  1011.       The check is made for 0 to 7F which is the normal range used.  If
  1012.       option /i is given without a value, ie followed by a space, then
  1013.       the range is increased to the maximum of FF which is 255 decimal.
  1014.       This will include Interrupt vectors which are used as data areas so
  1015.       can give spurious warnings.
  1016.  
  1017.       This /i option is also used to inform LOADSYS that the specified
  1018.       interrupt should be not be redirected when option /r is in force.
  1019.       This allows a mixture of redirected and direct interrupts.
  1020.  
  1021.       15.  When a program is unloaded by LOADSYS it may be necessary to
  1022.       close down a communications card or disable an interrupt in order
  1023.       to avoid crashing the machine.  The /p option allows this by
  1024.       specifying an I/O port and a byte value to be written (using OUT)
  1025.       to the port.  For a word port /pw is used.  The /m option does a
  1026.       similar job for memory where the αααα:αααα specifies the segment
  1027.       and offset of a byte.  To change a word /mw is used.
  1028.  
  1029.  
  1030.       The value may either be a hex or decimal (prefix 10#) number in
  1031.       which case the byte or word is completely changed or a binary
  1032.       pattern (prefix 2#) which allows selected bits to be changed.  In
  1033.       this instance values for ß are 0 to clear the bit, 1 to set the bit
  1034.       and x for dont change.  If less than the total number of bits are
  1035.       specified then the least significant ones are assumed and the
  1036.       higher bits are left unchanged.
  1037.  
  1038.       An example of selected bit changes is to shut down an interrupt
  1039.       by resetting the interrupt mask on I/O port 21. Thus for IRQ4 this
  1040.       would be /p21=2#1xxxx.
  1041.  
  1042.       The /m or /p option is normally supplied when a program is loaded
  1043.       and is implemented when the program is unloaded.  However they can
  1044.       be given on any other call to LOADSYS when they will be implemented
  1045.       immediately.
  1046.  
  1047.       If no value is supplied for the /m or /p option then the memory or
  1048.       I/O port is read and displayed.  This can be useful in ascertaining
  1049.       the current value.  For the loading and unloading cases the value
  1050.       is displayed before and after the action so any change can be
  1051.       noted.  Thus either of the following will cause the value of the
  1052.       port 2F9 to be printed:
  1053.  
  1054.         /p2f9
  1055.         /p2f9=
  1056.  
  1057.       Note also that reading some ports clears the setting and this could
  1058.       adversely affect a program using that port.
  1059.  
  1060.       On AT and XT type machines the maximum port value is 3ff (hex), on
  1061.       PS/2s this is increased to ffff though there are a lot of instances
  1062.       where the first digit is ignored.  Thus in the case of the BICC
  1063.       board where the I/O port is 28c for the 16 bit varient and 828c for
  1064.       the PS/2 MCA version the /p828c would work in on both machines.
  1065.  
  1066.       Further details are given in the section of Worked Examples.
  1067.  
  1068.       16.  The /3 option causes LOADSYS to obey an INT 3 instruction
  1069.       prior to running a program.  Normally this will have no effect but
  1070.       when LOADSYS is being run under DEBUG or CODEVIEW this will cause
  1071.       an entry into the debugger.  Note that under DEBUG the IP register
  1072.       has to be reset to the next instruction before execution can
  1073.       continue.  The facility is mainly for the debugging of Device
  1074.       Drivers.
  1075.  
  1076.       For a Device Driver the INT 3 is obeyed just before the Strategy
  1077.       routine is executed.  When this is complete the Interrupt routine
  1078.       is called.
  1079.  
  1080.       For a TSR the next instruction is the jump into the program and the
  1081.       main use in this case is to debug LOADSYS by seeing if registers
  1082.       etc are correctly initialised.
  1083.  
  1084.  
  1085.       17.  If loading a program causes Interrupt vectors to be changed
  1086.       but the new value does not point to the program then this is termed
  1087.       a Side Effect.  An example is the loading of SMARTDRV.SYS which
  1088.       causes HIMEM.SYS to link into Interrupt 15. The option /os stops
  1089.       LOADSYS from giving a warning message. The /i option can be used to
  1090.       record the Interrupt so it is reinstated when the program is
  1091.       unloaded. See also note 32.
  1092.  
  1093.       18.  When unloading or disabling a Device Driver, LOADSYS
  1094.       implements a Flush to clear out any buffers.  This can be inhibited
  1095.       by the option /of.
  1096.  
  1097.       19.  If memory is available above 640K an alternative to using /w
  1098.       to load programs into it is to include it in the DOS memory block
  1099.       chain.  On all systems upto DOS 5 this is by the /b option which
  1100.       causes LOADSYS to extend the chain to 1Mbyte if it has not been
  1101.       done already and to include the specified block.  Since the chain
  1102.       must be contiguous the ROM and screen buffers must also be included
  1103.       and these are marked as being owned by the BIOS.  The option /lb
  1104.       will list the new situation.  Note that the calls that obtain upper
  1105.       memory (/xx, xp and /xl) normally invoke /b so it is only required
  1106.       to be used directly in special cases.
  1107.  
  1108.       In order to extend the DOS memory block chain above 640K LOADSYS
  1109.       needs to be able to use the last paragraph in memory. This is
  1110.       usually available but should it need to be reserved then the call:
  1111.  
  1112.         loadsys /b
  1113.  
  1114.       will keep it for later use by LOADSYS.
  1115.  
  1116.       Once upper memory has been defined via the /b option subsequent
  1117.       loading of programs will use this memory in preference to low
  1118.       memory unless the /ol option is given.
  1119.  
  1120.       Upper memory can be released once it is no longer occupied by the
  1121.       call:
  1122.  
  1123.         loadsys /!b
  1124.  
  1125.       The above should not be used under DOS 5 and later systems where
  1126.       the DOS=UMB command should be used in CONFIG.SYS to achieve the
  1127.       same effect.
  1128.  
  1129.       By default DOS knows nothing about this extra memory even though it
  1130.       has been added to the DOS memory chain.  However it can be told
  1131.       about it by the option /xd and this allows programs which ask DOS
  1132.       for further memory to access the upper memory.  The /!xd option
  1133.       switches this feature off.
  1134.  
  1135.       See also the /xx /xp and /xl options and Notes 20 and 23.
  1136.  
  1137.  
  1138.       20.  The /xf option attempts to remove the memory fragmentation
  1139.       that control programs such as Windows 3 object to.  All LOADSYS
  1140.       control blocks that are located at the top of low memory are moved
  1141.       down the memory.  All subsequent program loads in low memory force
  1142.       the /oa option and ignore the /t option to prevent further blocks
  1143.       being located in this area.  Fragmentation is automatically allowed
  1144.       again once the control program has been loaded.  The option /!xf
  1145.       also allows memory fragmentation to occur.
  1146.  
  1147.       The /xf option also works with DOS 5 when the DOS=UMB command is
  1148.       present in CONFIG.SYS and retrieves the 4K bytes of memory that is
  1149.       normally lost when Windows 3 is loaded. In this case it must be
  1150.       given just before WIndows 3 is loaded since it removes access to
  1151.       upper memory from the LOADHIGH command.
  1152.  
  1153.       The reason for /xf is twofold.  Firstly if lower memory is not
  1154.       exactly a multiple of 4K (eg.  exactly 640K) then Windows will
  1155.       reduce the lower memory to a value that is (eg 636K).  This can
  1156.       occur when the last paragraph is used to extend the memory chaining
  1157.       into upper memory by either LOADSYS or DOS5.
  1158.  
  1159.       Secondly the last block of memory must be the main free block and
  1160.       hence there must be no small blocks at the end of low memory.  If
  1161.       there are then Windows 3 will refuse to load complaining of memory
  1162.       fragmentation and DESQview will not show any upper memory that is
  1163.       in use.  Thus any such blocks created by LOADSYS must be moved
  1164.       either down low memory or into upper memory if it is available and
  1165.       this one of /xf actions.
  1166.  
  1167.       See the Usage Guidelines Section for further details.
  1168.  
  1169.       21.  LOADSYS has to take special action in order to unload an
  1170.       Expanded Memory Manager (EMM) so such programs have to be noted.
  1171.       This is usually done by checking whether the program has switched
  1172.       the PC into Virtual 8086 mode.  However some managers do not switch
  1173.       immediately and the /ov option is provided as an alternate way of
  1174.       notifying LOADSYS.
  1175.  
  1176.       The /ov option is assumed by default for any device driver with a
  1177.       name of the form EMM or ?EMM.
  1178.  
  1179.       On Compaq 386 machines most EMMs also switch off ROM shadowing thus
  1180.       increasing the available number of pages.  By default the ROM
  1181.       shadowing is switched back on when any program noted as being an
  1182.       EMM is unloaded by LOADSYS.  The /ov option also causes LOADSYS to
  1183.       switch off ROM shadowing when the program is loaded.  Giving the
  1184.       /or option overrides both these features.
  1185.  
  1186.       See also note 22
  1187.  
  1188.       22.  On Compaq 386 machines the /xr option will switch on the ROM
  1189.       shadowing and /!xr will switch it off. Note that when ROM shadowing
  1190.       is off then screen updating will be slower.
  1191.  
  1192.  
  1193.       23.  LOADSYS provides the ability to interface onto memory managers
  1194.       supporting the EMS/LIM or XMS interfaces and uses them to provide
  1195.       upper memory. These are not required under DOS 5 where the
  1196.       CONFIG.SYS command DOS=UMB,HIGH should be used.
  1197.  
  1198.       Where the EMS/LIM v4.0 or LIM 3.2 interface is available the option
  1199.       /xp takes all the pages and disables the LIM interface thus making
  1200.       the maximum amount of memory available.  Unless the /ob option is
  1201.       given it then does an internal call of the /b option to add this
  1202.       memory to the DOS memory chain.  Subsequent calls to LOADSYS will
  1203.       attempt to load programs in the memory unless the /ol (override
  1204.       lower) option is given when low memory is used.
  1205.  
  1206.       For all but LIM 3.2 managers if it is required to run programs
  1207.       which use the EMS/LIM interface then the /xl option should be used
  1208.       instead of /xp.  This by default gives four pages (64K) for LIM
  1209.       usage and uses the rest for program loading.  /xl can be optionally
  1210.       followed by a number indicating how many LIM pages to use.  Note
  1211.       that LOADSYS has to put its own small driver in front of the EMS
  1212.       manager in order to hide the extra pages that it has taken.
  1213.       Sophisticated users of LIM may thus get confused.
  1214.  
  1215.       Once programs have been unloaded by LOADSYS the upper memory can be
  1216.       released by the /!xp or /!xl options. These will abort if the
  1217.       memory is still in use. /!xp or /!xl must also be given before an
  1218.       Extended Memory Manager is unloaded.
  1219.  
  1220.       Alternatively if an XMS v2.0 interface manager is available which
  1221.       provides access to upper memory then this can be utilised via the
  1222.       /xx option.  This can optionally be followed by the the number of
  1223.       paragraphs to allocate otherwise all the available upper memory is
  1224.       obtained.  Again /!xx releases the memory.
  1225.  
  1226.       If it is required to obtain the available XMS from memory from a
  1227.       given area then use of the /a /xx options without any parameter
  1228.       will show the amount of memory that the XMS provides.  Then release
  1229.       the XMS memory (/!xx) and use this value as the parameter.  Note
  1230.       the value will be slightly less than expected since the XMS manager
  1231.       uses some paragraphs for its own memory management.
  1232.  
  1233.       /xxαααα can only be used once (unless /!xx is used) except when a
  1234.       control program is present when it can be used from each DOS
  1235.       session subject to their being sufficient available memory.
  1236.  
  1237.       Note that the XMS management of upper memory is done by maintaining
  1238.       a chain of blocks in a similar way the DOS memory management. This
  1239.       has no impact on the use of upper memory unless it is accessed vi
  1240.       aboth the /xx and /xp or /xl options. In this case the EMS/LIM
  1241.       memory would normally have a one paragraph block on either side
  1242.       which was part of the XMS memory management. This would prevent the
  1243.       EMS/LIM free memory from being merged with any adjacent XMS
  1244.       provided free memory. LOADSYS gets round this by removing the
  1245.       EMS/LIM memory from the XMS memory chain and reinstating it when
  1246.       the memory if freed. The XMS memory chain can be listed by the /lx
  1247.       option.
  1248.  
  1249.  
  1250.       24.  DOS 3.x systems use 528 bytes of memory per buffer to
  1251.       impliment the BUFFERS parameter in CONFIG.SYS which occupies lower
  1252.       memory.  By giving a small BUFFERS value in CONFIG.SYS (eg
  1253.       BUFFERS=1) and using the LOADSYS option /xb followed by a decimal
  1254.       number then the additional buffers can be allocated from memory in
  1255.       accordance with same rules as for loading programs (Note 6).  No
  1256.       value or 0 gives the current buffer count.  Thus if upper memory is
  1257.       available via an EMM which has been loaded via CONFIG.SYS then
  1258.       buffers can be allocated from it by the AUTOEXEC.BAT having
  1259.       something something similar to:
  1260.  
  1261.         loadsys /xp             ; Use all memory pages above 640K
  1262.         loadsys /xb20           ; Increase DOS buffers to 20
  1263.  
  1264.       The number can be increased by giving a larger number and also can
  1265.       be reduced back to original CONFIG.SYS value by giving the /!xb
  1266.       option. The latter is actually very dangerous but appears to work -
  1267.       it should only be used for testing purposes. /!xb does not work
  1268.       when the buffers are not held on a DOS buffer chain.
  1269.  
  1270.       This option can also be used under DOS 5 but it is more efficient
  1271.       to use the facilities of DOS 5 to achieve the same effect.
  1272.  
  1273.       In DOS 3.x and DOS 5 systems the buffers are all held in one chain.
  1274.       DOS 4.x systems are different in that the buffers can be held in
  1275.       one or more chains and each chain is held within a 64K segment of
  1276.       memory.  DOS uses 532 bytes per buffer and tests suggests that it
  1277.       increases the number of chains when the minimum possible chain size
  1278.       is 15.  Thus at BUFFERS=30 it uses two chains and at 45 uses 3.
  1279.  
  1280.       The algorithm implemented by LOADSYS under DOS 4 is as follows and
  1281.       will only operate where DOS is not using EMS to hold its buffers.
  1282.       If the initial BUFFERS value is 1 then the first call of LOADSYS
  1283.       /xb creates a single chain of buffers containing the number
  1284.       specified.  Some of the 532 bytes of the original buffer is used
  1285.       for a control block but the bulk is unused.  Subsequent calls
  1286.       create additional chains of the same size as the first until the
  1287.       total buffer request is reached.  If the request is not modulo the
  1288.       chain size then the excess is ignored.
  1289.  
  1290.       If the initial BUFFERS value is greater than 1 then additional
  1291.       chains of the same size as the first are created. In this case the
  1292.       control block is appended to the front of the first buffer chain
  1293.       added by LOADSYS and contains enough space to add 31 chains.
  1294.  
  1295.       Thus differing combinations of chain size and number can be
  1296.       experimented with to achieve optimal performance.
  1297.  
  1298.  
  1299.       25.  The /xc and /xe options allow the current COMMAND.COM and the
  1300.       DOS Environment to be moved.  If a second COMMAND.COM is in use
  1301.       then this is acted upon rather than the primary copy.  Under DOS 5
  1302.       it is only possible to move the secondary copy.
  1303.  
  1304.       Where they move to conforms to the same rules as loading a program
  1305.       (Note 6).  Thus if upper memory is available via an EMM driver then
  1306.       both items can be moved to upper memory by the commands:
  1307.  
  1308.         loadsys /xc
  1309.         loadsys /xe
  1310.  
  1311.       Adding the option /a gives further details and /ou aborts the move
  1312.       if upper memory is not available.
  1313.  
  1314.       The /xe option also deletes the superfluous copy of the environment
  1315.       when a second COMMAND.COM is in use if the option /oe is given.
  1316.  
  1317.       Giving the /z option with a size in hex paragraphs allows the
  1318.       Environment size to be increased.  Thus when running a second
  1319.       COMMAND.COM (eg under Windows 3) the following will increase the
  1320.       size of the environment to 256 bytes (Hex 10 paragraphs).
  1321.  
  1322.         loadsys /xet /z10
  1323.         loadsys /xe
  1324.  
  1325.       This works by moving the environment up memory and increasing its
  1326.       size. The second call moves it back down memory and is optional.
  1327.  
  1328.       26.  On the PS/2 IBM introduced the Extended BIOS Data Area (XBDA)
  1329.       which is a 1Kbyte block at the end of normal memory which is
  1330.       outside the normal DOS memory management.  This can give problems
  1331.       for programs which convert the video ram into accessible memory.
  1332.       The /xt option allows it to be moved according to the same rules as
  1333.       for program loading defined in Note 6. Thus a call of:
  1334.  
  1335.         loadsys /xt
  1336.  
  1337.       would move the XBDA into low memory and free up the last 1Kbytes. A
  1338.       more useful sequence would be where an EMM driver has been loaded
  1339.       via CONFIG.SYS:
  1340.  
  1341.         loadsys /xt           ; move XBDA into bottom of low memory
  1342.         loadsys /xp           ; expand memory blocks to upper memory
  1343.                               ; alternatively /xx or /xl could be used.
  1344.         loadsys /xt           ; move XBDA again - by default it now goes
  1345.                               ; to upper memory. Frees 1K of low memory.
  1346.  
  1347.       It has been noted that some systems such as Windows 3 do not work
  1348.       if the XBDA is in upper memory.
  1349.  
  1350.       27. When DOS executes a BAT file it uses a 64byte buffer as a work
  1351.       buffer and if a TSR is being loaded then this memory leave a hole.
  1352.       Using the /xw option along with /t moves the buffer to the top of
  1353.       memory thus allowing the TSR to be loaded at the lowest possible
  1354.       point. If several BAT files have been CALLed then all working
  1355.       buffers are moved.
  1356.  
  1357.  
  1358.       28. /oo is an experimental option which allows LOADSYS to run a
  1359.       normal program and monitor if it loads a subsequent program. When
  1360.       this occurs the original program is swopped out of memory thus
  1361.       increasing the available memory. The most usual use is when a
  1362.       program has the facility to execute DOS commands.
  1363.  
  1364.       In order to keep the monitor that LOADSYS leaves in memory to a
  1365.       minimum size (currently 7K) several restrictions and limitations
  1366.       are imposed.  The program is always loaded in low memory using the
  1367.       DOS internal loader and it must not be a TSR.  No checks on changes
  1368.       to interrupts are done so no checks for a virus are made.  It is
  1369.       assumed that a subsequently loaded program makes no use of its
  1370.       parent.
  1371.  
  1372.       If the /oo option is used in any other circumstances then the
  1373.       machine will probably crash.
  1374.  
  1375.       LOADSYS implements /oo by monitoring the use of INT 21 function 4B
  1376.       (EXEC).  It only reacts to calls from the program it loaded.  It
  1377.       writes the program out to a file @loadsys.@@a in the current root
  1378.       directory (usually C:\) unless this file already exists when the
  1379.       last letter (a) is incremented until a unique name is found.  Thus
  1380.       several copies of LOADSYS using this feature can be run.  The file
  1381.       is deleted on termination but will be left if the system crashes.
  1382.  
  1383.       29. The /xh option records the current directory as the home
  1384.       directory and the /!xh option resets the current directory to the
  1385.       home directory. Multiple calls of LOADSYS with the /xh option will
  1386.       stack the various home settings and /!xh will remove the last
  1387.       entry. The option /!xhr will repeatedly implement the /xh settings
  1388.       until no more are present. The /uh option removes the last /xh
  1389.       record with implementing it and and /uhr option removes all such.
  1390.  
  1391.       30. The /s option stops LOADSYS from giving out anything other than
  1392.       warning or major error messages. /ss surpresses the warnings as
  1393.       well. When the option /s is given then the name LOADSYS is placed
  1394.       in front of most warning and error messages in order to identify
  1395.       their source and the LOADSYS command that generated the error is
  1396.       displayed.
  1397.  
  1398.       31.  The /oq option is designed to allow a LOADSYS command to only
  1399.       be executed if conditions are right.  If a warning message is given
  1400.       about the options specified then the command is aborted.  Thus the
  1401.       general default that LOADSYS ignores option errors that are not
  1402.       fatal is overridden.  See note 6 for its effect on the /w option.
  1403.  
  1404.       32.  LOADSYS detects the use of Expanded, Extended and the HMA
  1405.       memory by a program when it is loaded and releases such memory when
  1406.       the program is unloaded.  It will also detect when a program chains
  1407.       into the XMS driver and will correct this at unloading.  The option
  1408.       /om overrides these features.  Option /a gives details of the use
  1409.       of such memory at loading, unloading and listing via the /l option.
  1410.  
  1411.  
  1412.       Note that LOADSYS is unable to detect if the memory is being used
  1413.       by the program being run or some other system that has been
  1414.       activated as a result. When this side effect occurs then the /om
  1415.       option must be given otherwise when the program is unloaded the
  1416.       memory belonging to the other system will be released and this
  1417.       will probably crash the PC.
  1418.  
  1419.       33.  LOADSYS relocates itself in memory in order to facilitate the
  1420.       loading of programs. Thus it moves itself to near the top of DOS
  1421.       memory when loading a program and the bottom of low memory. If the
  1422.       /t option has been given then it stays put. When loading in upper
  1423.       memory it also moves to the top of DOS memory just in case there is
  1424.       insufficient space in upper memory and the program is forced into
  1425.       lower memory. However there are some cases, such as TSRs which
  1426.       relocate themselves to the top of low memory, where LOADSYS gets in
  1427.       the way and this results a large block of free memory at the top
  1428.       of memory.
  1429.  
  1430.       To overcome this the /ok option tells LOADSYS to keep where it is,
  1431.       that is at the base of low memory. Note if this option is given
  1432.       with a normal TSR or Device Driver then a large block of free
  1433.       memory at the bottom of memory will result.
  1434.  
  1435.       The LOADSYS option /lb will display the memory usage.
  1436.  
  1437.       34. The option /oh asks LOADSYS to attempt to load a program into
  1438.       the High Memory Area and is of limited use. It is for experts
  1439.       only and may probably crash the PC.
  1440.  
  1441.       It will only work with .COM programs that do not change their
  1442.       segment register when accessing their data.  Thus .EXE programs and
  1443.       Device Drivers are excluded.  There must also be an XMS manager
  1444.       operating in order to control usage of the HMA (eg.  HIMEM.SYS) and
  1445.       the program must not chain into INT 21.  Note that only one program
  1446.       at a time may use the HMA.
  1447.  
  1448.       If the HMA is not in use LOADSYS claims it and loads the program
  1449.       starting at address FFFF0. Since this includes the last 16 bytes of
  1450.       the BIOS ROM area the first 16 bytes of the programs PSP will not
  1451.       be correct. Hence the program cannot terminate in the normal manner
  1452.       and so LOADSYS has to catch its exit by monitoring INT 21. Program
  1453.       loading can be done at addresses lower than this via the /w option
  1454.       but note that further parts of the PSP will be incorrect and
  1455.       bizzarre effects may occur. Most notable may be the loss of of all
  1456.       output from the porgram since the I/O handles are held in the
  1457.       second 16 bytes of the PSP.
  1458.  
  1459.       35.  The option /* indicates that the remainder of the command is a
  1460.       comment.  It cannot be used when loading programs as it would be
  1461.       included as a parameter to the program.  It is useful in BAT files
  1462.       to add comments to LOADSYS commands to remind you what they do and
  1463.       also if the /s option is given the comment is displayed as well as
  1464.       the LOADSYS command should an error occur.
  1465.  
  1466.  
  1467.  
  1468.       4. Usage Guidelines
  1469.       ===================
  1470.  
  1471.       The following give some general guidelines on usage. See also the
  1472.       Worked Examples Section.
  1473.  
  1474.       4.1 BAT files
  1475.       -------------
  1476.  
  1477.       The recommended method of using LOADSYS is via BAT files.  Thus the
  1478.       mechanism can be tested out and user finger trouble is avoided. The
  1479.       later section of worked examples illustrates most of the techniques
  1480.       described below.
  1481.  
  1482.       For programs that normally require a Device Driver in CONFIG.SYS a
  1483.       BAT file should be written which uses LOADSYS to load the Device
  1484.       Driver(s) before invoking the main program and then unloads them
  1485.       again afterwards.
  1486.  
  1487.       Similarily programs such as PRINT can be loaded via a BAT file
  1488.       which uses LOADSYS to run PRINT.COM.  To retrieve the memory used
  1489.       after printing has finished LOADSYS /U PRINT should do the trick.
  1490.  
  1491.       For systems which may load a variety of programs depending on
  1492.       options selected the following technique is available to simplify
  1493.       the unloading process.  The BAT file should have the line
  1494.  
  1495.         loadsys /sn
  1496.  
  1497.       before any programs are loaded which will set the /n option on last
  1498.       program loaded by LOADSYS (if any).  The /s avoids worrying the
  1499.       user with an error message if there is no previous LOADSYS loaded
  1500.       program.  The unloading can then be achieved by the line:
  1501.  
  1502.         loadsys /ur
  1503.  
  1504.       which will terminate unloading at the named entry.
  1505.  
  1506.       Whilst this technique is suitable for a system where all the
  1507.       LOADSYS calls are within one BAT file it is not satisfactory where
  1508.       say one BAT file loads a system and a second unloads it because the
  1509.       /ur takes no account of any more programs subsequently loaded via
  1510.       LOADSYS.  Examples are communications drivers where the kernel is a
  1511.       TSR and various utilities provide the communications applications.
  1512.       The solution is to name of the last program loaded in the unload
  1513.       call for example:
  1514.  
  1515.         loadsys /ur tsr_name
  1516.  
  1517.       where tsr_name is the last program in the group that is to be
  1518.       loaded and thus the first to be unloaded.
  1519.  
  1520.       LOADSYS sets the BAT file ERRORLEVEL at 0 if it is successful and 1
  1521.       if not.  No indication of ignored options is shown unless the
  1522.       option /oq is given when they cause LOADSYS to abort with an
  1523.       ERRORLEVEL of 1.
  1524.  
  1525.  
  1526.       4.2 Upper Memory
  1527.       ----------------
  1528.  
  1529.       Where upper memory is going to be used there is a choice of
  1530.       methodologies. EMMs such as QEMM and 386MAX have their own
  1531.       programs to allow loading in upper memory. However they lack the
  1532.       unloading facility so using LOADSYS can be advantageous. It is
  1533.       probably unwise to mix the two though tests with the LOADHIGH of
  1534.       DOS 5 and LOADSYS show they can both be used.
  1535.  
  1536.       Where there is the choice, such as with QEMM, accessing upper
  1537.       memory via the XMS interface (/xx) is better since this allocates
  1538.       in 4K byte units rather than the 16K byte pages used by EMS (/xp
  1539.       and /xl). It is thus usually able to obtain more upper memory.
  1540.  
  1541.       The option /ou is useful for moving items to upper memory since it
  1542.       can be used to abort the action if it does not exist. For example
  1543.  
  1544.         loadsys /xcou
  1545.  
  1546.       will move COMMAND.COM to upper memory but only if it exists.
  1547.  
  1548.       Similarily the /oq option can be used to be more selective in
  1549.       placing a program. Thus the command
  1550.  
  1551.         loadsys /wgE000 /oq program
  1552.  
  1553.       will fail to load if it cannot optain memory above E000 thus
  1554.       allowing a second choice of where to load it.  If the /oq had not
  1555.       been given then an attempt would have been made to load the program
  1556.       first in the whole of upper memory and then in lower memory.  Note
  1557.       that a BAT file could test the ERRORLEVEL reply to see if it had
  1558.       been successful - for example
  1559.  
  1560.         loadsys /sswgE000 /oq program
  1561.         IF ERRORLEVEL 0 GOTO OK
  1562.         loadsys /sswgD000 /oq program
  1563.         IF ERRORLEVEL 0 GOTO OK
  1564.         loadsys /sswgC000 /oq program
  1565.         IF ERRORLEVEL 0 GOTO OK
  1566.         loadsys /ss program
  1567.         :OK
  1568.  
  1569.       The IF ERRORLEVEL could actually be left out since LOADSYS will
  1570.       refuse to load the program a second time and would thus plough on.
  1571.       The /ss is included so as not to alarm the user.
  1572.  
  1573.       4.3 Control Programs (Windows 3 and DESQview)
  1574.       ---------------------------------------------
  1575.  
  1576.       LOADSYS is cogniscent of two control programs - Windows 3 and
  1577.       DESQview.  These provide a special challange in that on a 386
  1578.       machine they can provide several DOS sessions.  This gives problems
  1579.       with memory management since some memory is shared (eg that below
  1580.       the control program) and some is unique (usually from the end of
  1581.       the control program to 640k).  Where upper memory is used then this
  1582.       compounds the problems.
  1583.  
  1584.  
  1585.       Before running a control program all programs loaded via LOADSYS
  1586.       should have the /oa option and the command:
  1587.  
  1588.         loadsys /xf
  1589.  
  1590.       must be given. It is best given just before the control program is
  1591.       loaded but can be given earlier and subsequent program loadings
  1592.       or memory block relocations should conform.
  1593.  
  1594.       It can also be given to DOS 5 when the DOS=UMB command is present
  1595.       in CONFIG.SYS and will retrieve 4K bytes of lower memory that would
  1596.       normally be lost.  If it is not given then upper memory will also
  1597.       not be visible since the chaining has been broken.
  1598.  
  1599.       After a control program has been loaded then LOADSYS can be used as
  1600.       before and fragmentation is allowed again.  The first use of
  1601.       LOADSYS will remove the fragmentation and reinstate the memory
  1602.       chain to its correct setting.  It is therefore recommended that
  1603.       every use of the DOS box commences with the command:
  1604.  
  1605.         loadsys /!xf
  1606.  
  1607.       The /lb option will show the shared and unique areas of memory and
  1608.       program loading/unloading and memory block relocation will be
  1609.       confined to the latter area.  If the /xl, /xp or /xx option is used
  1610.       to obtain upper memory then any shared upper memory will cease to
  1611.       be displayed and only that unique to the DOS session will be shown.
  1612.  
  1613.       The only exception is under Windows 3 when /xp or /xl has been
  1614.       used to obtain upper memory before Windows 3 is loaded. Because
  1615.       a unique copy of this area is supplied the upper memory cannot be
  1616.       displayed by /lb. Further upper memory can still be obtained via
  1617.       /xp or /xl. It is strongly recommended the /xx is used to obtain
  1618.       upper memory before loading Windows 3 as /xp or /xl supplied memory
  1619.       can cause it not to load.
  1620.  
  1621.       It has been noted that moving the Extended Bios Data Area (XBDA)
  1622.       on a PS/2 to upper memory causes Windows 3 to fail.
  1623.  
  1624.       4.4 Additional Features
  1625.       -----------------------
  1626.  
  1627.       LOADSYS can also be used to run normal programs.  It will complain
  1628.       that they are not a TSR but it will also note and correct any
  1629.       changes made to the Interrupts on the system.  It is thus useful
  1630.       for testing out any program that may change the Interrupts (such as
  1631.       one that may contain a virus).  The /i option is recommended so
  1632.       that all interrupts are checked but be warned that some of the
  1633.       higher interrupts are used as data areas so can confuse the issue.
  1634.  
  1635.       LOADSYS can be used to record the current directory when running
  1636.       a system requires a switch to another directory. Thus a BAT file
  1637.       to run such a system could be of the form:
  1638.  
  1639.  
  1640.         loadsys /xh
  1641.         .
  1642.         . commands to run system
  1643.         .
  1644.         loadsys /!xh
  1645.  
  1646.       LOADSYS can also be used to examine the value of I/O ports or
  1647.       memory locations and also to reset them if required.  Thus to
  1648.       examine the value of I/O port 28c you type:
  1649.  
  1650.         loadsys /p28c
  1651.  
  1652.       which will display the value,
  1653.  
  1654.         loadsys /p28c=04
  1655.  
  1656.       will reset the value to hex 04 and
  1657.  
  1658.         loadsys /p28c=2#xxxxx1xx
  1659.  
  1660.       will set bit 2.
  1661.  
  1662.       Be warned that reading an I/O port can reset its value in some
  1663.       cases - see the appropriate technical documentation.
  1664.  
  1665.       The features in LOADSYS to display various aspects of DOS can be
  1666.       quite useful. For example the /lb option which displays memory
  1667.       blocks gives an insight into what DOS (and also LOADSYS) does with
  1668.       memory.
  1669.  
  1670.       Option /lf shows which files are open and to what programs. Adding
  1671.       /a gives the whole table including all files opened and closed.
  1672.  
  1673.       The /xb option to increase the DOS file buffers can be useful for
  1674.       optimisation of how many DOS buffers are really needed by an
  1675.       application.  The number of buffers allocated can be increased
  1676.       between timing an application without having to reboot the machine.
  1677.  
  1678.       If the DOS Environment is too small then introducing new parameters
  1679.       via the SET command can fail with a message to that effect.  This
  1680.       can occur when either the Environment is too small or when a
  1681.       secondary Command processor is in use (eg when DOS is invoked from
  1682.       within a program) and the Environment is not expandable.  Moving
  1683.       the Environment using the /xe option along with the /z option to
  1684.       define a new size will increase the size of the Environment.  For
  1685.       example to increase the size to 512 bytes use:
  1686.  
  1687.         loadsys /xe /z20
  1688.  
  1689.       As this will leave a gap at the bottom of memory where the old
  1690.       Environment was it is best to move it to the top of memory and then
  1691.       back down again. If this was being done in a BAT file then the
  1692.       recommended sequence is:
  1693.  
  1694.         loadsys /xw /t         /* move DOS working buffer for BAT file up
  1695.         loadsys /xe /t         /* DOS Environment up memory
  1696.         loadsys /xe /z20       /* DOS Environment increased to 512 and
  1697.                                /* moved down memory
  1698.  
  1699.       5. Worked Examples
  1700.       ==================
  1701.  
  1702.       The following worked examples show the use of LOADSYS and cover
  1703.       most of the aspects of its use.  Note that if upper memory has been
  1704.       allocated via the /b, /xx, /xp or /xl options or under DOS 5 via
  1705.       the DOS=UMB command in CONFIG.SYS then this will be used in
  1706.       preference to low memory.
  1707.  
  1708.       5.1 PRINT
  1709.       ---------
  1710.  
  1711.       An example of a PRINT.BAT file could be:
  1712.  
  1713.         @ECHO OFF
  1714.         loadsys /ss2r print %1 %2 %3 %4 %5
  1715.  
  1716.       which appears to behave in an identical manner to the normal PRINT
  1717.       command due to the /ss option cutting out all the LOADSYS
  1718.       reporting.  The /r option should be omitted for DOS 2.x systems.
  1719.       The PRINT.BAT file must be held in a directory that precedes the
  1720.       directory holding PRINT.COM in the DOS PATH.  On a RAL system that
  1721.       would be C:\BAT.  Note that as LOADSYS ignores the PRINT.BAT entry
  1722.       when searching down the DOS PATH it will find PRINT.COM in a later
  1723.       directory.
  1724.  
  1725.       A further development on this is to load the PRINT.COM program at
  1726.       the top of memory.  To achieve this you have to include details of
  1727.       how much memory is required.  For an MS-DOS 3.3 system the LOADSYS
  1728.       command would be of the form:
  1729.  
  1730.         loadsys /ss2roatz25e print %1 %2 %3 %4 %5
  1731.  
  1732.       where the /z25e option reserves 25e paragraphs to load PRINT.COM.
  1733.       Note that this value was found by loading PRINT.COM with a /z
  1734.       parameter without a value and then experiment (which will crash the
  1735.       machine if the /z value is too low!).  The gain is that further
  1736.       TSRs can be loaded into low memory and the removal of PRINT.COM
  1737.       will not leave a gap in memory.  Note that the cost is an unused
  1738.       free area at the top memory which was required for the PRINT.COM
  1739.       initialisation code.
  1740.  
  1741.       To simplify the user interface an addition option /u can be
  1742.       introduced into PRINT.BAT in order to unload PRINT.COM.  The BAT
  1743.       file could then be of the form:
  1744.  
  1745.         @ECHO off
  1746.         IF %1.==/u. GOTO UNLOAD
  1747.         IF %1.==/U. GOTO UNLOAD
  1748.         loadsys /ss2roatz25e print %1 %2 %3 %4 %5
  1749.         GOTO EXIT
  1750.         :UNLOAD
  1751.         loadsys /uu print
  1752.         :EXIT
  1753.  
  1754.       And unloading can be achieved by the command:
  1755.  
  1756.         print /u
  1757.  
  1758.  
  1759.       5.2 Communications Cards
  1760.       ------------------------
  1761.  
  1762.       Care is needed when unloading communications drivers since the
  1763.       interrupt mechanisms of the card have to be disabled before the
  1764.       driver can be removed from memory. This section gives general
  1765.       details of how this is done and the following sections give
  1766.       specific examples.
  1767.  
  1768.       Two techniques are available.  The simplest is to disable the IRQ
  1769.       line that the card is using.  This is achieved by setting the
  1770.       appropriate bit in the interrupt mask which is accessed by I/O port
  1771.       21. This is done via the LOADSYS /p option as detailed in the
  1772.       following table.
  1773.  
  1774.         IRQ        LOADSYS Option
  1775.         ---        --------------
  1776.  
  1777.         IRQ3       /p21=2#1xxx
  1778.         IRQ4       /p21=2#1xxxx
  1779.         IRQ5       /p21=2#1xxxxx
  1780.         IRQ6       /p21=2#1xxxxxx
  1781.         IRQ7       /p21=2#1xxxxxxx
  1782.  
  1783.       On reloading the communications driver should reset the mask to
  1784.       enable interrupts again.  If it does not then the options above can
  1785.       be used with the 1xx..  set to 0xx..
  1786.  
  1787.       Whilst this technique often works it has some drawbacks. It will
  1788.       not work where the card has been given a pointer into the
  1789.       driver memory and examples of this are the BICC 16bit and MCA
  1790.       cards.  It is also not viable in cases where the IRQ is being
  1791.       shared by several devices as is possible on PS/2 machines.
  1792.  
  1793.       A more hygenic approach is to shut down the card itself and this
  1794.       requires some knowledge of the interface. This can be gleaned from
  1795.       technical documentation or from the code of a driver. A very good
  1796.       source for ethernet cards is the Packet Driver source code which is
  1797.       usually supplied with the driver. The routine RESET_INTERFACE does
  1798.       as its name suggests and mimicing this will achieve the desired
  1799.       result.
  1800.  
  1801.       The following table gives the options required to shut down certain
  1802.       cards. For the ethernet cards it is assumed they are set up for
  1803.       their default I/O port which is usually 300.
  1804.  
  1805.            Card           LOADSYS Option
  1806.            ----           --------------
  1807.  
  1808.          Asynch COM1        /p3f9=0
  1809.          Asynch COM2        /p2f9=0
  1810.          BICC 8bit          /mc000:10=0   (Assume memory mapped at C000)
  1811.          BICC 16bit/MCA     /p828c=4
  1812.          3COM 3C501         /p30e=80
  1813.          3COM 3C503         /p300=21 /p307=ff /p30f=0
  1814.          NE1000/2000        /p31f=ff
  1815.  
  1816.  
  1817.       It is usual to put the option onto the LOADSYS call which loads the
  1818.       communications driver and it will be implemented when the driver is
  1819.       unloaded. This appears to work very well but it is possible to
  1820.       envisage a case where the removal of TSRs that implement higher
  1821.       levels of the protocol could crash the machine as the driver tries
  1822.       to communicate with them in the brief interval before it too is
  1823.       terminated. Moving the option to the first TSR to be unloaded will
  1824.       aleviate this possibility.
  1825.  
  1826.       Most communications drivers can be run in upper memory, the main
  1827.       exception being the 16bit and MCA BICC cards whose drivers must be
  1828.       run below 640K.  For the BICC cards this limitation applies right
  1829.       up to the program that communicates with the driver.  This includes
  1830.       ETHDRV, BDNINT, PCNFS and the RAL LLCPKT program.  The option /ol
  1831.       on the LOADSYS calls will enforce this and since LOADSYS does not
  1832.       object to /ol if there is no upper memory then a BAT file to run in
  1833.       either situation should include it.
  1834.  
  1835.       The following examples illustrate these techniques and also
  1836.       highlight other problems.
  1837.  
  1838.  
  1839.       5.3 RAINBOW
  1840.       -----------
  1841.  
  1842.       The following details the loading and unloading of ethernets card
  1843.       with the RAINBOW software.
  1844.  
  1845.       Note that for reasons that are not quite clear RAINBOW is sometimes
  1846.       unable to reestablish contact with the RAL IBM host after the
  1847.       communications software has been unloaded and loaded again.
  1848.       Unloading and loading the whole system or just PINKBOOK usually
  1849.       cures the problem.
  1850.  
  1851.       5.3.1 RAINBOW over BICC 8 bit card using MPS v3
  1852.       +++++++++++++++++++++++++++++++++++++++++++++++
  1853.  
  1854.       A BAT file to run the RAINBOW software could be as follows:
  1855.  
  1856.         : RAIN.BAT - file to load and unload RAINBOW
  1857.         loadsys /sxh
  1858.         cd \isolan
  1859.         loadsys /s bdnldr
  1860.         loadsys /s /mc000:10=0 sfb
  1861.         loadsys /s!xh
  1862.         pinkbook
  1863.         rainbow
  1864.         pinkbook /de
  1865.         loadsys /suu sfb
  1866.         loadsys /suu bdnldr
  1867.  
  1868.       where the RAINBOW.EXE and PINKBOOK.EXE programs are held in a
  1869.       directory in the PATH and the card is at memory address C000.
  1870.       The LOADSYS calls with /xh and /!xh are optional and ensure that
  1871.       the user returns to the directory he started from.
  1872.  
  1873.  
  1874.       Tests suggest that you can get away without disabling the card
  1875.       interrupts.  Thus the /mc000:10=0 could be omitted from the SFB
  1876.       load to make a BAT file that was independent of the card location.
  1877.  
  1878.       Be warned that SFB modifies the entry point of BDNLDR when it loads
  1879.       so it is not possible to just load and unload SFB. Even if this
  1880.       modification is corrected and the card reset it has still been
  1881.       found necessary to reload it for reasons which are not understood.
  1882.  
  1883.       5.3.2 RAINBOW over BICC cards using MPS v4
  1884.       ++++++++++++++++++++++++++++++++++++++++++
  1885.  
  1886.       It is recommended that the BICC installation procedure is followed
  1887.       and the parameters for the calls of BICCARB, BICCDLC or MBICCDLC
  1888.       obtained from CONFIG.SYS.  Then by removing them from CONFIG.SYS
  1889.       and also the NETCON call in AUTOEXEC.BAT it is possible to load and
  1890.       unload the software.
  1891.  
  1892.       A BAT file to run the RAINBOW software on a 8bit card could be as
  1893.       follows:
  1894.  
  1895.         : RAIN.BAT - file to load and unload RAINBOW
  1896.         loadsys /sxh
  1897.         cd \isolink
  1898.         loadsys /s /m40:a1=0 biccarb.sys
  1899.         loadsys /s /mc000:10=0 biccdlc.sys ST=7 SA=4
  1900.         netcon
  1901.         loadsys /s!xh
  1902.         pinkbook
  1903.         rainbow
  1904.         pinkbook /de
  1905.         loadsys /suu biccdlc
  1906.         loadsys /suu biccarb
  1907.  
  1908.       where the comments in the previous example apply.  MPS v4 uses
  1909.       location 40:a1 to act as a flag and this needs to be reset to zero
  1910.       before the drivers can be reloaded.
  1911.  
  1912.       The 16bit and MCA varients are similar with the BICCDLC.SYS call
  1913.       replaced by the appropriate MBICCDLC.SYS call with the /ol
  1914.       parameter added to prevent loading in upper memory.  A general call
  1915.       suitable for both cards would be of the form:
  1916.  
  1917.         loadsys /sol /p828c=4 mbiccdlc.sys /D3 /IA ST=7 SA=4
  1918.  
  1919.       where the card is at the default I/O Port of 280 for 16bit and
  1920.       8280 for MCA, using IRQ10 and DMA channel 3. Note the 16 bit
  1921.       machine ignores the top 8 in the 828c port address.
  1922.  
  1923.       In this case disabling of interrupts is done by writing to I/O Port
  1924.       (8)28c where (8)280 is the base port setting.  The initial value of
  1925.       the port is 04 and after startup with IRQ10 being used the value
  1926.       becomes 73.  Resetting it to 04 at unload disables the interrupts.
  1927.  
  1928.       PINKBOOK appears to work satisfactorily from upper memory so if it
  1929.       could be put there by LOADSYS.  Note that it must be unloaded by
  1930.       the PINKBOOK /DE command and not by LOADSYS so that it can be
  1931.       restarted.
  1932.  
  1933.  
  1934.       5.3.3 RAINBOW over BICC cards using Packet Driver
  1935.       +++++++++++++++++++++++++++++++++++++++++++++++++
  1936.  
  1937.       An alternate and more memory efficient method of running RAINBOW is
  1938.       over a Packet Driver rather than MPS.  This is most relevent when
  1939.       using PADPORT to support a terminal emulator such as EMUTEK or
  1940.       MOS2.  Two BAT files are defined called for example PADLOAD.BAT and
  1941.       PADUNLOAD.BAT which load and unload the Rainbow programs.  PADLOAD
  1942.       is run first then the application (eg EMUTEK) is run.  When it is
  1943.       required to regain the memory used PADUNLOAD is called.  Beware of
  1944.       loading any other TSRs or Device Drivers after PADLOAD since they
  1945.       will prevent the memory being reclaimed.  For a 16bit and MCA BICC
  1946.       card set up as described previously and with the packet driver
  1947.       using Interrupt 62 the BAT files could be as follows:
  1948.  
  1949.         : PADLOAD.BAT - file to load PADPORT, PINKBOOK and Packet Driver
  1950.         loadsys /sn
  1951.         loadsys /sol /p828c=4 \isolink\mbdndpd.com 0x62 /I10 /D3
  1952.         loadsys /sol \isolink\llcpkt.com
  1953.         pinkbook
  1954.         padport
  1955.  
  1956.  
  1957.         : PADUNLOAD.BAT - file to unload PADPORT etc
  1958.         padport /de
  1959.         pinkbook /de
  1960.         loadsys /sur llcpkt
  1961.  
  1962.       where MBDNDPD.COM is the packet driver for the BICC 16bit and MCA
  1963.       cards and LLCPKT.COM is the RAL interface program to emulate the
  1964.       MPS interface over a packet driver.
  1965.  
  1966.       Both PINKBOOK and PADPORT could be loaded in upper memory via
  1967.       LOADSYS.
  1968.  
  1969.       5.3.4 RAINBOW over other cards using Packet Driver
  1970.       ++++++++++++++++++++++++++++++++++++++++++++++++++
  1971.  
  1972.       For any other card for which there is a Packet Driver available the
  1973.       line:
  1974.  
  1975.         loadsys /s /p828c=4 \isolink\mbdndpd.com 0x62 /I10 /D3
  1976.  
  1977.       should be replaced with the appropriate call and the /ol option can
  1978.       be omitted.
  1979.  
  1980.       Thus for the 3C501 card on default settings the line becomes:
  1981.  
  1982.         loadsys /s /p30e=80 \3com\3c501.com 0x62
  1983.  
  1984.       and for the 3C503 card it becomes:
  1985.  
  1986.         loadsys /s /p300=21 /p307=ff /p30f=0 \3com\3c503.com 0x62
  1987.  
  1988.  
  1989.       5.4 TCP/IP
  1990.       ----------
  1991.  
  1992.       5.4.1 PC/TCP over BICC cards
  1993.       ++++++++++++++++++++++++++++
  1994.  
  1995.       The following gives details of using LOADSYS with the PC/TCP
  1996.       package.  Other TCP/IP implementations would be supported in a
  1997.       similar manner.  Two BAT files are defined called for example
  1998.       IPLOAD.BAT and IPUNLOAD.BAT which load and unload the TCP/IP
  1999.       kernel.  IPLOAD is run first then the various applications (TN3270,
  2000.       FTP or MAIL) are run.  When it is required to regain the memory
  2001.       used IPUNLOAD is called.  Beware of loading any other TSRs or
  2002.       Device Drivers after IPLOAD since they will prevent the memory
  2003.       being reclaimed.  For a 16bit and MCA BICC card the BAT files could
  2004.       be as follows:
  2005.  
  2006.         : IPLOAD.BAT - file to load PC/TCP over MPS v4
  2007.         loadsys /sn
  2008.         loadsys /sxh
  2009.         cd \isolink
  2010.         loadsys /s    /m40:a1=0 biccarb.sys
  2011.         loadsys /sol  /p828c=4 mbiccdlc.sys /D3 /IA ST=7 SA=4
  2012.         netcon
  2013.         loadsys /s!xh
  2014.         loadsys /s    \pctcp\ipcust.sys
  2015.         loadsys /sn   \pctcp\ifcust.sys
  2016.         loadsys /snol \pctcp\bdnint
  2017.  
  2018.  
  2019.         : IPUNLOAD.BAT - file to unload PC/TCP
  2020.         c:\pctcp\inet unload
  2021.         loadsys /suur ifcust.sys
  2022.  
  2023.       Strictly speaking BDNINT need not be loaded by LOADSYS since the
  2024.       INET call is used to unload it. As is explained in section 8 there
  2025.       is a bug/feature in this system and using LOADSYS corrects for it.
  2026.  
  2027.       If a program such TN3270 or TNVT is used to access another system
  2028.       then it can be loaded by LOADSYS with the /oo option so that when
  2029.       Alt-F10 and !  are used to execute DOS commands the TNx program is
  2030.       swopped out of memory thus allowing larger programs to be run.
  2031.       Note that this inhibits any processing of output from the other
  2032.       system so no indication that a message has been received is given.
  2033.  
  2034.       To reduce memory usage the packet driver interface can be used and
  2035.       in this case the IPLOAD file changes to:
  2036.  
  2037.         : IPLOAD.BAT - file to load PC/TCP over BICC Packet Driver
  2038.         loadsys /sn
  2039.         loadsys /sol  /p828c=4 \isolink\mbdndpd.com 0x62 /I10 /D3
  2040.         loadsys /s    \pctcp\ipcust.sys
  2041.         loadsys /sn   \pctcp\ifcust.sys
  2042.         loadsys /snol \pctcp\ethdrv
  2043.  
  2044.  
  2045.       5.4.2 PC/TCP over other cards using Packet Driver
  2046.       +++++++++++++++++++++++++++++++++++++++++++++++++
  2047.  
  2048.       This is similar to the use with Rainbow.  Thus for the 3COM 3C503
  2049.       card the IPLOAD file now becomes:
  2050.  
  2051.         : IPLOAD.BAT - file to load PC/TCP over 3COM 3C503 Packet Driver
  2052.         loadsys /sn
  2053.         loadsys /s  /p300=21 /p307=ff /p30f=0 \3com\3c503 0x62
  2054.         loadsys /s  \pctcp\ipcust.sys
  2055.         loadsys /sn \pctcp\ifcust.sys
  2056.         loadsys /sn \pctcp\ethdrv
  2057.  
  2058.  
  2059.       5.5 PC-NFS
  2060.       ----------
  2061.  
  2062.       5.5.1 PC-NFS over Packet Driver
  2063.       +++++++++++++++++++++++++++++++
  2064.  
  2065.       The following BAT files will load and unload PC-NFS over the Packet
  2066.       Driver interface for a BICC 16bit or MCA card.
  2067.  
  2068.         : NFSLOAD.BAT - file to load PC-NFS
  2069.         loadsys /sn
  2070.         loadsys /s     \nfs\sockdrv.sys
  2071.         loadsys /solof \nfs\pktd.sys
  2072.         loadsys /sol   /p828c=4 \isolink\mbdndpd.com 0x62 /I10 /D3
  2073.         loadsys /soe   \nfs\prt *
  2074.         loadsys /snol  /i5 /i8 /i17 /i20 /i21 /i27 /i2f /i30 /i31 ...
  2075.            ... \nfs\pcnfs.sys /b1
  2076.         loadsys /s ansi
  2077.         nfsrun
  2078.         loadsys /su
  2079.  
  2080.         : NFSUNLOAD.BAT - file to unload PC-NFS
  2081.         loadsys /suur pcnfs
  2082.  
  2083.       The example shows the use of the /of for PKTD.SYS in order to
  2084.       prevent LOADSYS doing a flush before unloading the program.  If not
  2085.       this will crash the machine.  Also noteworthy is that LOADSYS needs
  2086.       notifying of the fact that PCNFS uses several interrupts that dont
  2087.       get activated until NFSRUN is executed.
  2088.  
  2089.       PKTD.SYS and PCNFS.SYS must be in lower memory for BICC 16bit and
  2090.       MCA cards. They can be in upper memory for all other cards.
  2091.  
  2092.       The /oe on the PRT loading is because this program releases its
  2093.       Environment after loading. The /oe prevents this leaving a gap
  2094.       in memory by loading the Environment at the top of memory.
  2095.  
  2096.       Note the /b1 on PCFNFS.SYS to give all ones IP broadcast.  This
  2097.       MUST be included at RAL
  2098.  
  2099.  
  2100.       The optional loading and unloading of ANSI.SYS is to cater for
  2101.       NFSRUN which needs it for its highlighted output.  This avoids the
  2102.       need to have ANSI.SYS permanently loaded and saves 1600 bytes of
  2103.       memory. Under DOS 5 the option /r will have to be added when
  2104.       ANSI.SYS is loaded since it now uses INT 2F as does PC-NFS.
  2105.  
  2106.  
  2107.       5.5.2 PC-NFS over 3COM cards
  2108.       ++++++++++++++++++++++++++++
  2109.  
  2110.       The 3COM 3C503 card is run by a different driver when used with
  2111.       PC-NFS. The NFSLOAD file therefore becomes:
  2112.  
  2113.         loadsys /sn
  2114.         loadsys /s   \nfs\sockdrv.sys
  2115.         loadsys /s   /p300=21 /p307=ff /p30f=0 /ib /i1c \drivers\vecie5.sys
  2116.         loadsys /s   \nfs\nfsvec.sys
  2117.         loadsys /soe \nfs\prt *
  2118.         loadsys /sn  /i5 /i8 /i17 /i20 /i21 /i27 /i2f /i30 /i31 ...
  2119.            ... \nfs\pcnfs.sys /b1
  2120.         nfsrun
  2121.  
  2122.  
  2123.       5.6 PC3270
  2124.       ----------
  2125.  
  2126.       The IBM PC3270 emulator can be run from upper memory by use of the
  2127.       following commands:
  2128.  
  2129.         loadsys /s /p2d4=2#1xxxxxx0 \pc3270\pc3270 nr
  2130.         loadsys /s \pc3270\eehllapi
  2131.  
  2132.       The last line could be omitted if EEHLLAPI is not required.  If
  2133.       Alt-5 is used to close down PC3270 then LOADSYS will give a warning
  2134.       message and delete its control block at its next use.  A BAT file
  2135.       to perform both loading and unloading could be of the form:
  2136.  
  2137.         : PC3270.BAT - file to load and unload IBM PC3270 v1.x
  2138.         IF %1.==/u. GOTO UNLOAD
  2139.         IF %1.==/U. GOTO UNLOAD
  2140.         loadsys /s /p2d4=2#1xxxxxx0 \pc3270\pc3270 nr
  2141.         loadsys /s \pc3270\eehllapi
  2142.         GOTO EXIT
  2143.         :UNLOAD
  2144.         loadsys /suu eehllapi
  2145.         loadsys /suu pc3270
  2146.         :EXIT
  2147.  
  2148.  
  2149.       5.7 MOS2
  2150.       --------
  2151.  
  2152.       The RAL 3270 Emulator MOS2 can also be run from upper memory by use
  2153.       of LOADSYS. The MOS2.BAT file should be modified as follows to
  2154.       allow both loading and unloading:
  2155.  
  2156.         IF %1.==/u. GOTO UNLOAD
  2157.         IF %1.==/U. GOTO UNLOAD
  2158.         loadsys /sn
  2159.         loadsys /ss /ib /ic ns_async
  2160.         IF ERRORLEVEL 1 GOTO EXIT
  2161.         loadsys /ss keyio /d %2
  2162.         IF ERRORLEVEL 1 GOTO EXIT
  2163.         loadsys /ssos mos3270 %1
  2164.         GOTO EXIT
  2165.         :UNLOAD
  2166.         loadsys /suur mos3270
  2167.         :EXIT
  2168.  
  2169.       Note that MOS3270 gives side effects hence the /os option and
  2170.       NS_ASYNC uses the async ports and links into INTs C and B.  The /u
  2171.       option on KEYIO is best not used unless the memory manager reserves
  2172.       High Memory (the 64K above 1Mbyte). MOS2 can be either unloaded via
  2173.       the normal Alt-Ctrl-Esc mechanism or via the BAT file with the /u
  2174.       option. Note that in the first case LOADSYS will give a warning
  2175.       message when it is next invoked so say what has happened.
  2176.  
  2177.  
  2178.       5.8 Upper Memory
  2179.       ----------------
  2180.  
  2181.       The following example gives details of optimising the use of upper
  2182.       memory using QEMM 5.0 or 5.1 on a 386 type machine with VGA. It
  2183.       is not applicable to DOS 5 and later systems where the CONFIG.SYS
  2184.       command DOS=HIGH,UMB should be used along with HIMEM.SYS.
  2185.  
  2186.       CONFIG.SYS should contain something like the following and it is
  2187.       assumed that no EMS memory is going to me used:
  2188.  
  2189.         buffers=1
  2190.         country=044 437 C:\dos\country.sys
  2191.         shell=c:\dos\command.com c:\dos /e:512 /p
  2192.         device=c:\qemm51\qemm386.sys ram frame=none
  2193.         stacks=0,0
  2194.         files=40
  2195.  
  2196.       If EMS is required then the FRAME=NONE should be removed which will
  2197.       reduce the available upper memory by 64K.  The AUTOEXEC.BAT could
  2198.       then include the lines after the PATH has been setup:
  2199.  
  2200.         loadsys /sxwt
  2201.         loadsys /sxx
  2202.         loadsys /sxb25
  2203.         loadsys /sxcou
  2204.         loadsys /sxeou
  2205.         loadsys /soeoa c:\dos\keyb.com uk,,c:\dos\keyboard.sys
  2206.  
  2207.       This moves the BAT file working buffer out of the way, grabs all
  2208.       the upper memory, sets up 25 DOS file buffers, moves the
  2209.       COMMAND.COM and the ENVIRONMENT to upper memory and finally loads
  2210.       KEYB there.  This gives something of the order of 595K free memory
  2211.       on a DOS 3.3 system along with upwards of 160K of free upper
  2212.       memory, less 64K on a PS/2.  The /xc and /xe options have /ou to
  2213.       abort them if no upper memory exists.
  2214.  
  2215.       A subsequent call to a BAT file as shown previously could load a
  2216.       communications system in upper memory. Where these had a hot key
  2217.       switching system, such as in MOS2 or PC3270, you would have
  2218.       communications available all the time and no extra memory cost.
  2219.  
  2220.  
  2221.       6. Bugs/Features and Problem Programs
  2222.       =====================================
  2223.  
  2224.       The following list of programs need special action when being run
  2225.       under LOADSYS.  It is based upon limited experience so only covers
  2226.       a few cases at present.
  2227.  
  2228.       BICC ethernet cards - see worked examples above.
  2229.  
  2230.       ISOLINK.COM v1 - this was the first version of MBDNDPD, the packet
  2231.       driver for BICC 16bit and MCA cards.  It has a very interesting
  2232.       bug/feature.  In searching to find the BICC Ethernet card via the
  2233.       PS/2 POS system it uses I/O Port 96 to select which adapter card to
  2234.       interrogate and on exit leaves the register pointing to the card.
  2235.       Unfortunately there is a bug in the BIOS of early PS/2s in that
  2236.       when INT 15 Function C0 is used to find out details of the machine
  2237.       this gives the reply that the function is not implemented.  This is
  2238.       because it assumes I/O Port 96 is pointing to the motherboard.  The
  2239.       solution is to reset the value of I/O Port 96 to zero after
  2240.       ISOLINK.COM has been loaded as follows:
  2241.  
  2242.         loadsys /sp828c=4 isolink.com 0x62 /I10 /D3
  2243.         loadsys /sp96=0
  2244.  
  2245.       Known ramifications of this problem are that the PS/2 Mouse will
  2246.       not load and that XVIEW will only run once.
  2247.  
  2248.       CEMM.EXE and EMM386.EXE - These EMM drivers can be loaded but note
  2249.       that the full name must be given to avoid confusion with .COM
  2250.       varients and the /od option must be given to load it as a Device
  2251.       Driver.  For example:
  2252.  
  2253.         loadsys /od emm386.exe
  2254.  
  2255.       386MAX - this EMM cannot be unloaded by LOADSYS and although it
  2256.       claims to support XMS upper memory tests show this not to be the
  2257.       case so the /xx option does not work.
  2258.  
  2259.       The version of EMM386 supplied with Windows 3 does not support DMA
  2260.       therefore communications cards such as the BICC 16 bit and MCA
  2261.       versions will not work in a Windows 3 virtual machine. This
  2262.       does not apply to the DOS 4 and DOS 5 versions though reports
  2263.       suggest this may be machine dependent.
  2264.  
  2265.       HIMEM.SYS - use /i15 option as it chains into this interrupt after
  2266.       startup.
  2267.  
  2268.       The Novell NET5.COM program can be run from upper memory but when
  2269.       called with the /u option will not unload.  It should not be
  2270.       unloaded by LOADSYS as it will crash the PC.  Moving the DOS
  2271.       Environment into upper memory via LOADSYS /XE causes the LOGIN to
  2272.       the Novell Server to lock the machine.
  2273.  
  2274.       PC3270.COM - the IBM 3270 Emulator on an IBM PS/2 requires the IBM
  2275.       3278 card to be disabled at unloading with the option
  2276.       /p2d4=2#1xxxxxx0.  This is also recommended on all other machines
  2277.       but does not appear to crash the machine if ommitted.  The /oe
  2278.       option should not be used as this program accesses its copy of the
  2279.  
  2280.       environment.  As PC3270 has an unloading option LOADSYS should only
  2281.       be used when it is required to load PC3270 elsewhere in memory.
  2282.  
  2283.       Some programs object to the use of the top of the 640K memory by
  2284.       LOADSYS Control Blocks.  Examples are Windows 3 and any program
  2285.       that extends memory into the video area such as VIDRAM which comes
  2286.       with QEMM386.  Using the /oa option makes LOADSYS put the control
  2287.       block adjacent to the program.
  2288.  
  2289.       The following programs should either not be run with the /r option
  2290.       or have the offending interrupt (usually the one used to access the
  2291.       program) specifed by /i to make it direct.
  2292.  
  2293.       BICC Ethernet board drivers:  BICCDLC.SYS & MBICCDLC.SYS
  2294.  
  2295.       CEMM.EXE - Compaq 386 EMM driver
  2296.  
  2297.       PINKBOOK.EXE from the RAINBOW communications software.
  2298.  
  2299.       PRINT.COM under DOS 2.1.
  2300.  
  2301.       Any program that implements the Packet Driver interface for
  2302.       ethernet. Examples are MBDNDPD.COM and PBDNDPD.COM.
  2303.  
  2304.       Programs such as Sidekick which insist on being at the head of an
  2305.       Interrupt chain.
  2306.  
  2307.       The following are other problems with TSRs which have been noted:
  2308.  
  2309.       Most TSRs with the facility to unload themselves (eg PINKBOOK /DE)
  2310.       do not close the four files (CON input and output, AUX and PRN)
  2311.       that DOS opens by default for all programs.  The net result is that
  2312.       the DOS File Handle Cnt (as shown by LOADSYS /LF) is incremented at
  2313.       each load but not decremented at unload.  No problems have been
  2314.       noted as a result of this but on machines that are never switched
  2315.       off and TSRs are frequently loaded and unloaded things may go bang
  2316.       when the count goes negative.  LOADSYS unloads TSRs via DOS which
  2317.       thus closes any open files and resets the handle counters.
  2318.  
  2319.       Interesting side effects have been observed with TSRs written in C
  2320.       and compiled with the Microsoft C compiler. This is because
  2321.       programs produced by this compiler link into various interrupts
  2322.       when they are run and unlink at termination. A TSR therefore has to
  2323.       be very careful when it wishes to link into any of these
  2324.       interrupts. It is highly likely that the same problem will occur
  2325.       with Microsoft Pascal.
  2326.  
  2327.       This problem was highlighted by the TCP/IP BDNINT and ETHDRV
  2328.       programs which for reasons which are not quite clear link into INT
  2329.       0.  The program INET is used to unload them but this fails to reset
  2330.       INT 0 back to its correct value thus leaving it pointing into the
  2331.       memory the TSR has just vacated.  The reason appears to be that
  2332.       INET, being a C program, links into INT 0 and then commences to
  2333.       unload the TSR and unlink its interrupts including INT 0.  However
  2334.       when INET terminates it sets INT 0 back to its original value which
  2335.       points to the now unloaded TSR. The solution is to load such
  2336.       programs with LOADSYS and after they have been unloaded by INET the
  2337.       next call to LOADSYS will detect their removal and correct the
  2338.       problem.
  2339.  
  2340.  
  2341.       7. Differences in LOADSYS versions
  2342.       ==================================
  2343.  
  2344.       7.1 Version 1.0
  2345.       ---------------
  2346.  
  2347.       First release to prove that the techniques worked.
  2348.  
  2349.       7.2 Version 1.1
  2350.       ---------------
  2351.  
  2352.       This version will not work with programs that have already been
  2353.       loaded with version 1.0 as the LOADSYS Control Block format has
  2354.       been changed.  LOADSYS will detect this and abort.
  2355.  
  2356.       Before a program is unloaded LOADSYS now checks to see if any
  2357.       Interrupt Vectors in the range 0 to 7F point into its address
  2358.       space.  If so it refuses to do the unload just in case the program
  2359.       has linked into a further interrupt during its execution.  To
  2360.       override this limitation the option must be specified twice.  Thus
  2361.       the command
  2362.  
  2363.         loadsys /uu
  2364.  
  2365.       will force an unload to take place.  The /i option allows these
  2366.       extra interrupts to be noted.
  2367.  
  2368.       LOADSYS is now able to load EXE files that are Device Drivers -
  2369.       this did not work in v1.0.
  2370.  
  2371.       In order to add new facilities several options have had to be
  2372.       changed.  Aplogies for the inconvenience this causes.  The changes
  2373.       follow.
  2374.  
  2375.       Variants of the /o (override) option now replace the following
  2376.       options:
  2377.  
  2378.       /i - use internal DOS loader now /oi (override internal loader)
  2379.       /d - force loading as a device driver now /od (override device
  2380.            driver)
  2381.       /p - force loading as a TSR now /ot (override TSR)
  2382.       /v - force release of Environment now /oe (override Environment)
  2383.       /a - in conjuntion with loading a program to locate control block
  2384.            adjacent to the program now /oa (override adjacent)
  2385.  
  2386.       Other changes are:
  2387.  
  2388.       /ua - unload all programs now /ur (unload repeat) and the use of a
  2389.       filename in this context now indicates where to start unloading.
  2390.  
  2391.       /s - stop a program - now /d (disable)
  2392.       /g - go a stopped program - now /e (enable)
  2393.  
  2394.       /q - quiet now /s (silent)
  2395.  
  2396.       /m - move now /q (squeeze)
  2397.  
  2398.  
  2399.       The /a option now gives additional information at load and unload
  2400.       times.
  2401.  
  2402.       /iαα option introduced to allow extra interrupts to be noted
  2403.  
  2404.       /mαααα:αααα option introduced to display and reset memory values.
  2405.  
  2406.       /pαααα option introduced to display and reset I/O Port values.
  2407.  
  2408.  
  2409.       7.3 Version 1.2
  2410.       ---------------
  2411.  
  2412.       There have been no changes to any options so BAT files for version
  2413.       1.1 should still work.
  2414.  
  2415.       LOADSYS now reserves one paragraph at the top of memory in order to
  2416.       facilitate the expanded memory facilities.
  2417.  
  2418.       The /os option to override side effects was incorrect in version
  2419.       1.1 in that it did not record any changed interrupts.
  2420.  
  2421.       LOADSYS can now load QEMM.SYS and also very large EXE files - this
  2422.       did not work on previous versions.
  2423.  
  2424.       The /b option can be used to extend the DOS memory management upto
  2425.       1Mbyte thus allowing upper memory to be easily utilised.
  2426.  
  2427.       LOADSYS can now unload any 386 Expanded Memory Manager such as QEMM
  2428.       and EMM386.  The only exception so far found is 386MAX which has no
  2429.       abort mechanism.  LOADSYS can also change the ROM shadowing on
  2430.       Compaq machines when loading such drivers or directly via the /xr
  2431.       option.  It can also interface to any LIM 3.2 or 4.0 driver and
  2432.       make use of the memory pages these provide via the /xp or /xl
  2433.       options.
  2434.  
  2435.       The /xb option allows the DOS file buffer chain to be extended and
  2436.       suppliments the BUFFERS parameter in CONFIG.SYS.
  2437.  
  2438.       The /xp option extends the memory management into memory above 640K
  2439.       provided by an Expanded Memory Manager. The /xl does the same but
  2440.       leaves a window whereby LIM memory may be accessed.
  2441.  
  2442.       The /xc option allows COMMAND.COM to me moved and the /xe does the
  2443.       same for the DOS Environment.
  2444.  
  2445.       The /xt option moves the PS/2 Extended BIOS Data Area
  2446.  
  2447.       The /xf option fiddles the DOS memory chain to hide the control
  2448.       blocks at the end of lower memory.
  2449.  
  2450.       The /ls option lists various relevent system features including
  2451.       available free memory.
  2452.  
  2453.       The /lb option to list memory blocks does not now show those blocks
  2454.       occupied by LOADSYS itself.
  2455.  
  2456.  
  2457.       7.4 Version 1.2a Bug Fix Release
  2458.       --------------------------------
  2459.  
  2460.       When no stack was specified it was incorrectly positioned after the
  2461.       program and not just before the end.
  2462.  
  2463.  
  2464.       7.5 Version 1.3
  2465.       ---------------
  2466.  
  2467.       Version 1.3 is incompatible with previous versions because it has
  2468.       changed its control block formats.  Therefore if you have already
  2469.       used a previous version to load programs this version will
  2470.       complain.  Just install v1.3 and reboot the machine to cure it.
  2471.       There are no major changes in the v1.2 options so these should
  2472.       still work with v1.3.
  2473.  
  2474.       The error and warning message system has been improved and the
  2475.       program name LOADSYS precedes all such messages when the /s option
  2476.       has been given  so you have a sporting chance of finding out from
  2477.       where it originated. As a result additional warning messages may
  2478.       appear compared with v1.2 - the /ss option will surpress them.
  2479.  
  2480.       The /xx option allows LOADSYS to obtain memory from XMS
  2481.       memory managers.
  2482.  
  2483.       The /xh option records the current directory as home and /!xh
  2484.       returns to it.
  2485.  
  2486.       The /xb option now sets up file buffers for DOS 4.x systems.
  2487.  
  2488.       The /xw option moves BAT file working buffers.
  2489.  
  2490.       The /xc and /xe options operate on the COMMAND.COM and Environment
  2491.       of the current COMMAND.COM not the top level one as previously.  A
  2492.       bug has been fixed in /xc whereby if EXIT was used on a moved
  2493.       COMMAND.COM it crashed the machine.
  2494.  
  2495.       The /z option with the /xe option sets the size of the DOS
  2496.       Environment if it is greater than the original value. This allows
  2497.       the Environment to be increased in size when running under
  2498.       a secondary COMMAND.COM.
  2499.  
  2500.       The /ou option forces loading in upper memory and causes a failure
  2501.       if it does not exist.
  2502.  
  2503.       The /oq option causes LOADSYS to quit if any option generates a
  2504.       warning message.
  2505.  
  2506.       The /xf option implementation has been changed but its function is
  2507.       still to remove memory fragmentation prior to loading control
  2508.       programs such as Windows 3 and DESQview.
  2509.  
  2510.       The /oo option allows programs to be overlayed out of memory when
  2511.       they run other programs.
  2512.  
  2513.  
  2514.       The /r option can now be given with /q so that all possible
  2515.       programs are moved in memory.
  2516.  
  2517.       Some checks for the restrictions of DR-DOS v5 have been added
  2518.       though the tests were by no means exhaustive.
  2519.  
  2520.       The worked examples have been updated to reflect the latest
  2521.       versions of software and to fix errors notably in the NFS example.
  2522.  
  2523.       A bug whereby filenames greater than eight characters corrupted the
  2524.       LOADSYS control block has been fixed.
  2525.  
  2526.       A bug whereby side effect interrupts were not recorded correctly
  2527.       has been fixed.
  2528.  
  2529.       A bug in the /wl option whereby it did not load large files below
  2530.       the given value has been fixed.
  2531.  
  2532.       A bug whereby LOADSYS when unloading a program gave a long list of
  2533.       interrupts that it claimed were pointing to the program has been
  2534.       fixed. It only occurred on certain BIOS' such as those found on
  2535.       Tandon PCA machines.
  2536.  
  2537.       A bug whereby LOADSYS failed under DESQview has been fixed.
  2538.  
  2539.  
  2540.       7.6 Version 1.3a Minor Enhancement and Bug Fix Release
  2541.       ------------------------------------------------------
  2542.  
  2543.       The restriction that the /r (Redirection) and /i (Interrupt)
  2544.       options cannot occur together has been removed. All Interrupts
  2545.       specified by /i will not be redirected. Hence a mixture of
  2546.       redirected and direct interrupts is possible.
  2547.  
  2548.       The /lb (List Memory Blocks) option is now better annotated.
  2549.  
  2550.       The option /lp lists the those memory blocks containing programs.
  2551.  
  2552.       /? now gives help
  2553.  
  2554.       A filename used to denote a program already loaded can end in a *
  2555.       to indicate a wildcard.
  2556.  
  2557.       If an attempt to unload a device driver failed because its
  2558.       interrupts were in use by another program then the driver was left
  2559.       disabled and a subsequent attempt to unload it crashed the machine.
  2560.       This is now fixed.
  2561.  
  2562.       There is a very obscure bug whereby in some cases when the /XC
  2563.       option has been used under DOS 4 to move COMMAND.COM an attempt
  2564.       to DEL a read only file crashes the machine. Fixed in v1.3b.
  2565.  
  2566.       Limited testing has been done under a beta release of DOS 5. It has
  2567.       not proved possible to implement XB (Increase DOS file buffers) and
  2568.       XC (Move COMMAND.COM) only works for Secondary command processors.
  2569.       The first limitation is fixed in v1.4, the second is permanent.
  2570.  
  2571.  
  2572.       The /xr and /!xr to switch Compaq ROM shadowing on and off stopped
  2573.       working in v1.3 because a reorganisation of the code somehow
  2574.       dropped the call to the routine. Now reinstated.
  2575.  
  2576.       There was a bug in the treatment of side effects (Interrupts
  2577.       changed on loading a program which did not point to it) in that
  2578.       they were never reset on unloading.  The meaning of the /os option
  2579.       has therefore been changed in that it now means dont report side
  2580.       effects.  In order to have the side effect reset back when a
  2581.       program is unloaded the interrupt must now be specified via the /i
  2582.       option.
  2583.  
  2584.       Some problems with TSRs that move themselves in memory after
  2585.       loading have been fixed. However this area is rather fraught so may
  2586.       continue to give problems.
  2587.  
  2588.  
  2589.       7.7 Version 1.3b Minor Enhancement and Bug Fix Release for DOS 5
  2590.       ----------------------------------------------------------------
  2591.  
  2592.       LOADSYS gave error messages when the DOS=UMB command was present in
  2593.       CONFIG.SYS. This is because this command extends the DOS 5 memory
  2594.       chain into Upper memory in the same way as LOADSYS does and
  2595.       confused the latter. Now fixed.
  2596.  
  2597.       When the DOS=HIGH command is present in CONFIG.SYS then DOS 5 is
  2598.       run with address wrap round disabled so that it can access the
  2599.       memory above 1Mbyte.  This is done by enabling the A20 address
  2600.       line.  When a program is loaded the A20 line is disabled thus
  2601.       allowing wrap round again.  This has been added to LOADSYS and
  2602.       programs such as BDNINT and ETHDRV which used wrap round will fail
  2603.       on previous versions.  Note there is a bug/feature in that any
  2604.       interaction with DOS disables wrap round on entering DOS but does
  2605.       not reinstate it on returning to the program.  Thus any program
  2606.       that uses wrap round after accessing DOS will fail.
  2607.  
  2608.  
  2609.       7.8 Version 1.4
  2610.       ---------------
  2611.  
  2612.       Version 1.4 is incompatible with previous versions because it has
  2613.       changed its control block formats.  Therefore if you have already
  2614.       used a previous version to load programs this version will
  2615.       complain.  Just install v1.4 and reboot the machine to cure it.
  2616.       There are no major changes in the v1.3 options so these should
  2617.       still work with v1.4 but note the next two paragraphs.
  2618.  
  2619.       V1.4 is fully compatible with DOS 5 but as this has required major
  2620.       recoding and hence possibly new bugs you are advised to keep a copy
  2621.       of v1.3 just in case.
  2622.  
  2623.       LOADSYS now detects the use of Expanded, Extended and the HMA
  2624.       memory by a program when it is loaded and releases such memory when
  2625.       the program is unloaded.  It will also detect when a program chains
  2626.       into the XMS driver and will correct this at unloading.  The option
  2627.       /om overrides these features.  The option /a will give details of
  2628.       the use of such memory at loading, unloading and listing via the /l
  2629.       option.  This is the most likely new feature to give problems in
  2630.       cases which worked with v1.3 and the /om option should revert back
  2631.       to the v1.3 method of working.
  2632.  
  2633.       The /oh option allows certain types of program to be loaded into
  2634.       the HMA.
  2635.  
  2636.       Details of Extended, Expanded and HMA memory availability are now
  2637.       displayed by option /ls. Adding /a gives further details.
  2638.  
  2639.       There was a bug in v1.3 whereby if upper memory was obtained via
  2640.       both the /xx and /xp options then this corrupted the XMS memory
  2641.       chain.  Subsequent use of the XMS gave incorrect values for the
  2642.       amount of free memory.  This has now been fixed.
  2643.  
  2644.       The XMS memory block chain in upper memory can be listed by the /lx
  2645.       option.
  2646.  
  2647.       The /ok option now keeps LOADSYS where it is when loading a
  2648.       program. This is only required where a program relocates itself to
  2649.       the top of low memory which is where LOADSYS would normally have
  2650.       moved itself to.
  2651.  
  2652.       Further problems with upper memory provided via the DOS=UMB command
  2653.       in CONFIG.SYS have been fixed.  The option /xf to remove
  2654.       fragmentation now works with the DOS=UMB command and retrieves 4k
  2655.       bytes of memory that is normally lost when Windows 3 is loaded.
  2656.  
  2657.       When operating with the /s option and an error or warning occurs
  2658.       LOADSYS now displays the command that generated it.
  2659.  
  2660.       The option /* allows a comment to be added to a LOADSYS command
  2661.       except where programs are being loaded.
  2662.  
  2663.  
  2664.       LOADSYS now works with the 4DOS command processor and has been
  2665.       tested with v3.02.  Despite claiming to be compatible with
  2666.       COMMAND.COM this program appears not to allow memory blocks at the
  2667.       top of low memory.  Thus loading with /t fails and the LOADSYS
  2668.       Control Block must always be adjacent to the program (option /oa).
  2669.       Thus when running under 4DOS the /t is not allowed and /oa is
  2670.       forced on program loading.
  2671.  
  2672.  
  2673.       7.9 Version 1.4a Bug Fix Release
  2674.       --------------------------------
  2675.  
  2676.       Some debugging calls to INT 3 were inadvertantly left in the code.
  2677.       Now removed.
  2678.  
  2679.       7.10 Version 1.4b Minor Enhancement Release
  2680.       -------------------------------------------
  2681.  
  2682.       There was a bug in the interpretation of a named program in that
  2683.       LOADSYS searched through the order in memory ignoring the loading
  2684.       order. This was only noticeable when upper memory was in use and
  2685.       programs with the same name, either identical or due to wildcard
  2686.       matching, were being accessed.
  2687.  
  2688.       Therefore the meaning of filename has been redefined and this
  2689.       is best explained by an example. Consider the command:
  2690.  
  2691.         loadsys /u filename
  2692.  
  2693.       where filename can be a complete name or may end in a * to give a
  2694.       wildcard match. This will unload the last program to match this
  2695.       name in the order of loading. ie. Last load, last unload. To change
  2696.       this to the first loaded program the option /1 should be given.
  2697.       This has the consequence that a filename of just * now unloads the
  2698.       last program to be loaded or, if /1 is given, the first.
  2699.  
  2700.  
  2701.       Bugs fixes in /l listing for upper memory and HMA indication have
  2702.       been made.
  2703.  
  2704.       Minor improvements to /lb listing made for orphan blocks.
  2705.  
  2706.  
  2707.  
  2708.       8. Support and Acknowledgements
  2709.       ===============================
  2710.  
  2711.       Some of the techniques used in LOADSYS were described in the
  2712.       program DEVADD by Giles Todd in .EXE Vol 4, Issue 3, August 1989.
  2713.  
  2714.       LOADSYS is supplied free and is supported for all users at RAL on
  2715.       IBM PC and PS/2 computers and near clones.  Users outside RAL are
  2716.       requested in the first instance to obtain copies and help from
  2717.       their normal support sources.
  2718.  
  2719.       Academic user support organisations may seek help from RAL but the
  2720.       latter will only be given on a 'best endeavours' basis.
  2721.  
  2722.       There is no support for other organisations other than by private
  2723.       arrangement with the author.
  2724.  
  2725.       Updates of the software may be file transferred from the binary
  2726.       file LOADxx EXE (xx being version number without a point -
  2727.       currently 14) on the RAL IBM mainframe (UK.AC.RL.IB) disc PCSOFT
  2728.       192.  Executing the file will produce the program and
  2729.       documentation.  Further details of how this is done can be obtained
  2730.       by email from the author.
  2731.  
  2732.       Bug reports or problems should be reported, ideally by email, to
  2733.       Graham Robinson:
  2734.  
  2735.       Via JANET    : GWR@UK.AC.RL.IB         G W Robinson
  2736.       Via Internet : GWR@IB.RL.AC.UK         Atlas Centre
  2737.       UK Telephone : 0235 44 5636 or 6391    Rutherford Appleton Laboratory
  2738.       International: +44 235 44 5636         Chilton, Didcot
  2739.                                              Oxon,OX11 0QX,UK
  2740.